Question : create a for each loop for javascript in c#

I need to create a for each loop for javascript in my c# code.

I have a list variable.  I want to pass this into my java script, and then when my java script gets fired off,  i want it to go through the list and do something.

Basically i need to iterate through the lstStrLabels list.  and during each iteration, i need to grab the string value out of it, and put it in the sprint.pagecreate(....) function and pImage will be the value that is in the element in the array for the current itteration.

I am building this string i c#, and then I am passing it to my registerstartupscript.
1:
2:
3:
4:
5:
6:
7:
StrImage += "<script type=\"text/javascript\" language=\"javascript\">";
        StrImage += "var Sprint = document.getElementById(\"printdocument\");";
        StrImage += "var prname='" + subObj.strPrinterName + "';";
        StrImage += "var pImage='" + lstStrLabels + "';";
        StrImage += "var pNoCopies='" + subObj.iNoOfPrints.ToString() + "';";
        StrImage += "var Weg= SPrint.pagecreate(pImage, prname, pNoCopies);";
        StrImage += "</script>";

Answer : create a for each loop for javascript in c#

Yeah, you can delete all that... and make sure that you are killing all the cookies as well...  If that does not work, I don't know how to fix that cuz I cannot duplicate it on my machine...

CyanBlue
Random Solutions  
 
programming4us programming4us