How do I execute Javascript after submission of an ASP.NET form?
For example, if I got a submit button click after submission of page then I want to display a DIV which I have hidden on page.
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.
If you would only want to convert the hidden div to a visible one then that can be done on the server side. In the aspx, give the div an id and a runat=”server”. Then in the server side, set its display style attribute to ‘block’. For example, say the div is defined as
Then in the post event of the submit button you can set its style as given below:
If you only want to emit scripts after the post then using the ScriptManager you could use: