Solved

Forms Authentication - RedirectFromLoginPage Is Null

Posted on 2004-04-16
3
360 Views
Last Modified: 2012-06-21
I have a question which nobody seems to be able to answer - even the teacher on the ASP.NET course I have recently been on.

When using forms authentication, if the user manages to navigate himself straight to the login page, RedirectFromLoginPage is null and after a successful login it goes to the root default.aspx, even if you dont want it to!!! And you cant seem to change this.  So my question is, can you change this?  I want it to go the sub folder default.aspx, not the root default.aspx.

0
Comment
Question by:BlueEdger
3 Comments
 
LVL 10

Accepted Solution

by:
EBatista earned 125 total points
Comment Utility
try comparing the GetRedirectUrl property with String.Empty:

If Not FormsAuthentication.GetRedirectUrl = String.Empty Then
   Server.Transfer ("/SubFolder/Default.aspx" )
End If

or

If FormsAuthentication.GetRedirectUrl = String.Empty Or FormsAuthentication.GetRedirectUrl = "Default.aspx" Then
         Server.Transfer ("/SubFolder/Default.aspx" )        
        Else
         FormsAuthentication.RedirectFromLoginPage (UserName.Value, True)
End If

regards
0
 
LVL 1

Author Comment

by:BlueEdger
Comment Utility
Sorry, have been meaning to close my open questions for some time.

In the end, due to project time constraints, I gave up using forms authentication in the end, and just did the authentication myself - much easier!  So thanks Microsoft but as usual you've only come up with a half baked solution that doesnt work in the real world!

I must admit that I have not tested EBatista's solution (sorry I do appreciate your help), but am happy to award you the points.

Apologies for my lack of attentiveness.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now