I want to call 3 javascript functions on my .cs file, I tried this:
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
ClientScriptManager script = Page.ClientScript;
ClientScriptManager script2 = Page.ClientScript;
ClientScriptManager script3 = Page.ClientScript;
script.RegisterClientScriptBlock(this.GetType(), "key", "centerPopup1()", true);
script2.RegisterClientScriptBlock(this.GetType(), "key", "loadPopup1()", true);
script3.RegisterClientScriptBlock(this.GetType(), "key", "msg1()", true);
}
}
With no success, nothing happens on my Postbacks, but if I try just calling one of these functions, it works.
I believer you can only Register one StartupScript Block and multiple ClientScriptBlocks (different keys) Instead of creating multiple; have them next to one another.
Startup : will load in the Form ClientScript: bottom of page
script.RegisterClientScriptBlock(this.GetType(), "key", "centerPopup1();
loadPopUp1(); msg1();", true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With