I am running a Javascript from c# code.
for(int i=0;i<=2;i++)
{
Page.ClientScript.RegisterStartupScript(GetType(), "a", "foo("hello")", true);
}
Js File
Function foo(a){
alert(a);
//some other logic
}
Here, the problem is when i debug the code, i can see loop going for 3 times, but the alert appears only once.
Why does it appear only once ? How can I solve this ?
See Question&Answers more detail:os