ASP.Net - RedirectFromLoginPage alternative to default.aspx as the destination page?
Posted on 2004-08-31
I'm having some problems with asp.net and authorization.
What I want to happen is the user is presented with the first page which is a login page. they login fine and then have access to the rest of the site.
I have this
<authentication mode="Forms" />
<deny users="?" />
as part of my web config file.
and if the login is successful, this fires:
System.Web.Security.FormsAuthentication.RedirectFromLoginPage(intUsrID.ToString, False) where intUsrId is my user id. This sends the user to default.aspx automatically where the rest of the application works from.
This seems to work fine at home, where I can set the start page to be index.aspx BUT on the hosting server, they have default.aspx as the priority start file, so if it is present, this is the one that fires first, not index.aspx.
My question is:
Is there anyway to get the redirectfromloginpage to go to another page (rather than default.aspx). That way I could have the login on default.aspx and if successful, send them elsewhere.
Maybe it's just my mis-understanding of the whole thing, so I good explaination may do the trick!
Alternatives would be greatly accepted as well.
If you need anything else, please let me know.