Solved

Forms Authentication - RedirectFromLoginPage Is Null

Posted on 2004-04-16
3
369 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
EBatista earned 125 total points
ID: 10841286
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
ID: 11096020
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

729 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