I wish to execute a javascript function after asp.net postback with out using ajax.
I’ve tried the following in my even method with no luck:
Page.ClientScript.RegisterStartupScript(GetType(), "ShowPopup", "showCheckOutPopIn('Livraison',556);");
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should rather use the ScriptManager class, since the Page.ClientScript property is deprecated…
The advantage with ScriptManager is that it works with asynchronous postbacks, so if you are using AJAX it will not work with the ClientScriptManager.
Your code would look like this:
Note also that if you are using AJAX and have a piece of javascript code, that you want executed on multiple postbacks, then you should refer to your UpdatePanel in the firstargument e.g.: