0

I have an asp.net web site which uses asp.net membership to authenticate and authorize users. When a user is not authenticated and types url of some page from the web site, then the user is redirected to login.aspx with ReturnUrl initialized as the Page that was requested. Because of a requirement, I got rid of my login page. It still exists on the web site, but users would log on from a different site. As a result, I don't want unauthenticated access to a page to redirect to login.aspx page. I want to redirect users to some custom page I want. How can I achieve this?

1 Answer 1

2

The authentication node in the Web.config should be able to specify this. For example, in Forms authentication, one might have something like this:

<system.web>  
  <authentication mode="Forms">
    <forms loginUrl="~/MyCustomPage.aspx" />     
  </authentication>
  <authorization>
    <deny users= "?"/>
  </authorization>
<system.web>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.