Re: What Determines the Default Page (And How to Change)?



Mark,

(Sorry for the slow reply. I've been trying to work through some of these issues.)

Why don't you put a check into the default.aspx page itself? You can check if the user is currently authenticated and if so, determine where they should go. Essentially, your default page just becomes a redirecting agent. The tricky part though is you wouldn't be able to have a normal default.aspx page since you can't determine whether the person who is visiting it just returned to the site, or if they have been logged on for a while and are just navigating around. With the right structure though this can be a moot point, especially if the default.aspx page isn't something that they'll hit except when they return to the site.

Thanks but I don't believe that will work. Users who are not supposed to access the default page do not have access to the root folder. Therefore, it appears they just get taken to the login page even though they are already logged in and authentication code withing default.aspx would never get a chance to run. I thought about setting the access-denied page and having that forward them, but even that won't work because some users will not have access to the folder that page is in.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com


"Mark Fitzpatrick" <markfitz@xxxxxxxxxx> wrote in message news:Ovd$PzAJIHA.5468@xxxxxxxxxxxxxxxxxxxxxxx
The default page is determined by the web server and not something to be changed in code. Also, it's good not to mess with the list because it can affect perormance. The longer the list for example, the longer it takes IIS to check what is the default page for a directory.



--

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - Expression

"Jonathan Wood" <jwood@xxxxxxxxxxxxxxxx> wrote in message news:%23cWYpZ$IIHA.3672@xxxxxxxxxxxxxxxxxxxxxxx
My site requires all users to log on. Depending on the user's role, they will have access to a certain set of pages.

I implemented this by redirecting the user to the appropriate home page in the handler for the LoggedIn event of the Login control.

The problem is that users don't always go through the Login control. For example, if I check the Remember Me box and then disconnect and then reconnect, I go straight to default.aspx in the root folder withough having to log in again. And so my code doesn't have a chance to redirect the user based on role in this case.

I'm thinking the answer would be to modify the default page depending on the current role, but I'm not sure how to do that. I'm also curious if anyone has any better ideas.

Thanks.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com




.



Relevant Pages

  • Re: What Determines the Default Page (And How to Change)?
    ... the user is already authenticated and the current requested url is default.aspx, then apply your logic to redirect appropriately. ... "Jonathan Wood" wrote in message ... I implemented this by redirecting the user to the appropriate home page in the handler for the LoggedIn event of the Login control. ... For example, if I check the Remember Me box and then disconnect and then reconnect, I go straight to default.aspx in the root folder withough having to log in again. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.NET virtual path problem.
    ... Tryusing a root-relative path Root-relative ... paths always begin from the root folder of the web. ... It redirects ... > After authentication; ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: can someone explain this weird behaviour?
    ... IIS to also authenticate with another protocol before even allowing ... authentication scheme seems confusing, and I agree -- and that is why ... The "Dir Security" property you change is one of the ... But for the same asp.net application with the same login control etc.. ...
    (microsoft.public.inetserver.iis.security)
  • Re: Forms authentication credentials fail
    ... the login control does not work againt the section in web.config ... handle the authenticate event of the login control and call FormsAuthentication.Authenticate ... I have a site with an admin folder that is protected with forms ... to use my own user authentication for the rest of the site. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Image not showing in MasterPage during login
    ... I have the login control on a page (login.aspx ... Authentication began blocking access to all files, ... If you figure out the original reason, ...
    (microsoft.public.dotnet.framework.aspnet)