redirect - Identify the postback from a ASP.NET Login control -
i have <asp:wizard>
applicable logged-out user. if user logged in, he/she redirected page. on 1 of wizard steps, part of wizard, ask credentials via <asp:login>
control , log in user. presents problem.
according msdn: "when user uses login control log in web site, data in view state , post data lost. not perform actions in loggedin event rely on view state."
because of this, wizard control forgets step it's on after login process. msdn recommends: "if embed login control in wizardstep object, explicitly set activestepindex property in page_load event handler if user authenticated. wizard control not automatically advance next wizardstep object in scenario."
however, because view state lost, redirect logged-in users kicks in, sending user away page. what's best way determine, @ page load, of states user in?
- already logged in time ago; needs redirected.
- was logged in inside wizard; needs reach next wizard step.
thanks ideas.
you can set session variable when user logs in: session("loggedin") = now
when checking redirect user, check if loggedin @ least 3 minutes ago , redirect. because set session variable after logging in available (or maybe null if not logged in).
you might want create custom login control, inheriting login, sets session variable whenever user logs in:
public class mylogin : inherits login private sub mylogin_loggedin() handles me.loggedin httpcontext.current.session("loggedin") = end sub end class
Comments
Post a Comment