RedirectFromLoginPage

M

Murphy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top