0

We would like to display a particular web page when the role of people who are not administrators, sfaff and data entry administrators are logged in to our ASP.Net web site.

We would like to display the web page called EntryNotAllowed.aspx

This is what the markup in the Web.config file looks like that controls who can access the web page called Attendance.aspx:

<!-- Only administrators, staff and data entry administrators may access the web forms listed here. -->
<location path="Attendance.aspx">
<system.web>
  <authorization>
    <allow roles="Administrators,DataEntryAdministrators,Staff" />
    <deny users="*" />
  </authorization>
</system.web>
</location>

Is there something we can add to this coding to call that web page when the roles is not those shown here?

The coding works fine by blocking users to the Attendance.aspx web page but we also want to display EntryNotAllowed.aspx as well in this scenario.

Emad-ud-deen
  • 4,734
  • 21
  • 87
  • 152

1 Answers1

0

Please check the following thread where a custom approach is suggested - http://forums.asp.net/t/1660685.aspx/1 You will have to handle Application_EndRequest event and check where the access was denied and then redirect if necessary.

NT88
  • 947
  • 5
  • 25