I am using the authentication method provided by ASP.NET using the 'Forms' mode and have something like this the Web.config file: <forms name=".COOKIEDEV" loginUrl="login.aspx" protection="All" timeout="30" path="/"></forms> Things are working well, but if
there is not target url to go to after authentication, ASP redirects directly to default.aspx, which I suppose makes a lot of sense. However, what if the default page is not called default.aspx but something else - say index.aspx? Is there a way, may somewhere
in the Web.config file to specify the application (or directory) default page? This may well be a very trivial question - sorry I only got started on ASP.NET a couple of days ago.
You can set the authentication cookie manually using FormsAuthentication.SetAuthCookie and after that using Response.Redirect you can redirect user manually to the page you like (index.aspx, default.aspx whatsoever).
You can intercept the http request using a class that you create that implements IHttpModule interface, attach to the http modules chain in the web.config file under section, where you can redirect the request from form authentication default :default.aspx"
to any other page. Your redirect code should be in your class impementation of Application_PreRequestHandlerExecute procedure.
yourid
Member
50 Points
10 Posts
Default aspx page after login
Aug 01, 2003 07:40 AM|LINK
joteke
All-Star
46284 Points
6896 Posts
ASPInsiders
MVP
Re: Default aspx page after login
Aug 01, 2003 03:06 PM|LINK
Teemu Keiski
Finland, EU
Younis
Member
170 Points
34 Posts
Re: Default aspx page after login
Aug 02, 2003 04:29 PM|LINK
Mississauga - Ontario, Canada