i have a directory in my website that is protected from anonymous users. my web.config looks like this
<location path="members">
<system.web>
<authorization>
<allow roles="members" />
<deny users="*" />
</authorization>
</system.web>
</location>
if anonymous users try to access pages in the "/members" directory they will be redirected to the login page.
from the codebehind on the login page, is there a way to tell the difference between a user being redirected this way versus the user manually going to the login page? (either by typing in the url or clicking on a link to the login page)
i know the web is stateless so perhaps these two requests are indistinguishable
if it's not possible to distinguish between the two, is there a way to intercept what happens before .net decides to redirect the user because of an unauthorized access attempt?
note: i can't use the "ReturnUrl" in the querystring because i will decorate it the same way