Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp.net login - directory mix up

Status
Not open for further replies.

neroe

Technical User
Feb 27, 2003
54
0
0
GB
scenario
i have a site that has an admin section to it. the login page to the admin section is accessed using a similar url to this;
section/login.aspx

my problem is this piece of code(i think)

FormsAuthentication.RedirectFromLoginPag(txtUserName.Text, False)

what this does is direct the user to;

what i actually want it to do is send the user to;
section/default.aspx

my work is based on this article;
and works perfectly on my local machine. it is just this directory issue that is messing things up
any ideas anybody?
 
I think you are in the wrong section as this is for VB.NET and not ASP.NET.

However I will attempt to assist you.

The RedirectFromLoginPage command will redirect you back to the orginal URL from which you came.

Before I get to into it, do you understand how to secure pages using forms authentication?

Below is the code I use on one of the websites that we have created.

First it checks to see if there is a return URL in the querystring, if this is true then it has been redirected from another page, if this is not true then is has been called directy and needs to be redirected manually

If Len(Me.Request.QueryString("ReturnUrl")) > 0 Then
aSec.RedirectFromLoginPage(Me.txtMemberName.Text, False)
Else
aSec.SetAuthCookie(Me.txtMemberName.Text, False)
Me.Response.Redirect("Secure/")
Return
End If

Let me know if that has helped and/or if you need me to explain it in more detail.



AGIMA - professional web hosting is our business.

AGIMA Computing
 
thats great, thanks for your time
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top