Hi,
I am experiencing a behavior I can´t understand while building an ASP.NET 1.1 application.
I have two pages, Web1.aspx and Web2.aspx. On a button click event of Web1.aspx, I do a Server.Transfer to Web2.aspx. All is fine, since I am "passing parameters" among pages on the Context and it all works fine.
But then, on Web2.aspx I have another button, which I want to do certain things (not relevant so won´t describe them), BUT when I click on the button, before the click event handler is reached, the OnInit event is called on Web2.aspx again!!!
The problem is that on the initialization page I need code that depends on the Context from Web1.aspx, and on that second call the Context is lost so the initialization fails. I have also tried to set an attribute on the page to state when initialization is done (so as not to do it again after the first time... not pretty, I know , but it doesn´t work, it seems like a new Web2.aspx page is being instantiated. Even if I bypass (very ugly, don´t even want to explain how the problem on the OnInit method, the handler for the button click on Web2.aspx is never reached!!!
I am pretty sure there is something I am not understanding about the Server.Transfer process. It may, in fact, be pretty basic, since I´m not that experienced with ASP.NET... but I´m going crazy! Any help will be MUCH appreciated.
Thanks,
Juanjo
I am experiencing a behavior I can´t understand while building an ASP.NET 1.1 application.
I have two pages, Web1.aspx and Web2.aspx. On a button click event of Web1.aspx, I do a Server.Transfer to Web2.aspx. All is fine, since I am "passing parameters" among pages on the Context and it all works fine.
But then, on Web2.aspx I have another button, which I want to do certain things (not relevant so won´t describe them), BUT when I click on the button, before the click event handler is reached, the OnInit event is called on Web2.aspx again!!!
The problem is that on the initialization page I need code that depends on the Context from Web1.aspx, and on that second call the Context is lost so the initialization fails. I have also tried to set an attribute on the page to state when initialization is done (so as not to do it again after the first time... not pretty, I know , but it doesn´t work, it seems like a new Web2.aspx page is being instantiated. Even if I bypass (very ugly, don´t even want to explain how the problem on the OnInit method, the handler for the button click on Web2.aspx is never reached!!!
I am pretty sure there is something I am not understanding about the Server.Transfer process. It may, in fact, be pretty basic, since I´m not that experienced with ASP.NET... but I´m going crazy! Any help will be MUCH appreciated.
Thanks,
Juanjo