Scenario
I have a site where users can register for a course, I’m developing a new feature allowing existing students to login with an email & password and register using their previous details.
Architecture
Register.aspx contains an email and password textbox, a login button and a forgot password button. Completing the email and password and clicking the login button results in a cross-page postback to the login.aspx page. Clicking the forgot password button also results in a cross-page postback to the login.aspx page.
Knowing that PreviousPage will be an instance of the code behind class for the Register.aspx page how can I distinguish between the two events (Login/Forgot Password) in the Page_Load for the Login.aspx page?
Why not handle the button logic in the code behind then use transfer? That would be easiest as you would have two methods:
and
When you’re using the cross-page posting, you lose some of the context. You could add that back, however, in the control definition e.g.
Which you can then read like this: