I have a problem with ASP.NET.
I have button on ex. index.aspx which redirect us to index2.aspx, but before that, first page – index.aspx – was reloaded. I don’t need it because function in “load” is running again.
How to solve that problem?
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.
Use a link instead of a button, if you want that the user goes directly to the new page.
A button will always cause a PostBack and fire the Click event of the button, so you can deal with the user input.
You can also make sure the code in the Load event of the Page is not executed on PostBacks:
But as I said, the proper way to go is a Link.