Re: Can I Manually set return Url that RedirectFromLoginPage uses?

From: Ryan LaNeve (ryan@nolanevespam.com)
Date: 11/30/02


From: "Ryan LaNeve" <ryan@nolanevespam.com>
Date: Sat, 30 Nov 2002 17:40:39 -0500


"EarlT777" <earlt777@hotmail.com> wrote in message
news:eUfdJEKmCHA.2224@tkmsftngp02...
> Instead of setting forms authentication to automatically redirect users to
> my login page, I am handling that myself. that way, I can control which
> pages I want to validate. Also, because all my pages are actually
> UserControls, the normal automatic authentication does not work anyway.
>
> I can manually create a cookie with the return url and use that to
redirect
> the user after login, but it would be sweet if I could set the same
property
> that Forms authentication is setting and then be able to register and
> redirect the user with RedirectFromLoginPage. Is this possible?
>
> Thanks for your help!
>
> Earl
>

This is covered in the docs.

[from Remarks section of FormsAuthentication.RedirectFromLoginPage Method]
"Redirects, based on the contents of the URL key in the query string, or
redirects to Default.aspx if the return key does not exist."

Add a "?URL=X" value to the URL when you redirect to your login page.
Calling RedirectFromLoginPage( ) will then redirect to the X value.

Good luck,
Ryan LaNeve



Relevant Pages

  • Re: ASP 2.0 Membership API
    ... After successful authentication, you want to redirect back to the original application, but the returnURL parameter contains only /App1 as the URL. ... The solution to that problem is adding a local login page to the application that does a manual redirect to the central authentication application. ... if not you have to use cookieless auth ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Detecting Failed Authorization
    ... after every authentication request and before the user ... is redirected to any login page. ... > "Ken Dopierala Jr." ... >> 'Redirect where you want the user to go. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Response.Redirect with IE
    ... login page to another one after a successful login - Am I right? ... In that case, set the Authentication mode to "Forms" in Web.Config, set the ... You don't have to manually redirect, Forms Authentication will do it for you ... > From: Ken Dopierala Jr. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Default.aspx - newbie Q`
    ... check and redirect to the ReturnURL or Selected.aspx depending on the case. ... > and replace it with something that takes then straight to the login page. ... >> Curt Christianson ... >>> authentication ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Default.aspx - newbie Q`
    ... check and redirect to the ReturnURL or Selected.aspx depending on the case. ... > and replace it with something that takes then straight to the login page. ... >> Curt Christianson ... >>> authentication ...
    (microsoft.public.dotnet.framework.aspnet)