Re: RedirectFromLoginPage
From: Michael Giagnocavo [MVP] (mggUNSPAM_at_Atrevido.net)
Date: 04/13/04
- Next message: kai: "Re: EnableViewState="False" Does not take effect?"
- Previous message: Charles A. Lackman: "Re: Invalid Characters in ASP.NET ??"
- In reply to: Murphy: "RedirectFromLoginPage"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Apr 2004 15:04:31 -0400
Cowboy (Gregory Beamer) has a kludge:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&threadm=OoAA3VvQCHA.1636%40tkmsftngp13&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26safe%3Doff%26q%3Dformsauthentication%2Bredirect%2Bnot%2Bdefault.aspx
Alternatively, you could just create the ticket and set the cookie manually,
as well as do all redirection manually. You need to do this anyways to use
UserData (which I'm sure you can find a use for in your app).
-mike
MVP
"Murphy" <murphy@murphy.com> wrote in message
news:udxSvpBIEHA.828@TK2MSFTNGP12.phx.gbl...
>I am trying to code a workaround to avoid being redirected to default.aspx
> if the ReturnURL parameter is blank when the RedirectFromLoginPage method
> is
> called.
> Depending upon the login status the login button performs either a login
> or
> logout and the appropriate image is displayed, see below:
>
> '*******************************************************
> ' Displays the applicable image
> '*******************************************************
> Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
> If Request.IsAuthenticated = true Then
> imgSignInOut.ImageUrl="images/signout.gif"
> End If
> End Sub
>
>
> Interestingly before I altered the code and simply used the code below
> after
> the user completed a login everything worked perfectly:
> FormsAuthentication.RedirectFromLoginPage(customerId,
> RememberLogin.Checked)
>
>
> If I check the value of ReturnUrl and do a manual redirect if blank using
> the code below Request.IsAuthenticated remains false and as a result the
> page load event above always displays the login image...
> If Request.QueryString("ReturnUrl") ="" Then
> Response.Redirect("./")
> Else
> FormsAuthentication.RedirectFromLoginPage(customerId,
> RememberLogin.Checked)
> End if
>
>
> Any ideas ?
>
> Thanks
>
> Murphy
>
>
- Next message: kai: "Re: EnableViewState="False" Does not take effect?"
- Previous message: Charles A. Lackman: "Re: Invalid Characters in ASP.NET ??"
- In reply to: Murphy: "RedirectFromLoginPage"
- Messages sorted by: [ date ] [ thread ]