<dw*****@gmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
I am having an issue when I trigger a Response.Redirect, the Page_Load
fires on the page where the Response.Redirect was called. From what
I've read, this should not happen and the browser should be sent to
page that was passed in teh Response.Redirect page. The
AutoEventWireup is set to false on all pages. Any help would be
greatly appreciated.
Let's assume for a second that you've got an <asp:Button> control on a page
with some code behind which includes the Response.Redirect code.
1) Page loads first time - Postback is false - Page_Load fires
2) User clicks the button - page posts back - Postback is true - Page_Load
fires - code behind button executes and does the Response.Redirect
You can't stop the Page_Load event from firing - all you can do is wrap its
contents in a if(Page.IsPostback) {}
The Page_Load event will always fire regardless of what the rest of the code
on that page subsequently does...