I'm fairly new to coding and am stuck on this.

Say, there are 2 types of users: regular user (folks not specified in the project) and Admin (defined in security role).

I have a c# web app project that follows a site.Master for layout and for security roles (Admin only access).

However, I would like to make the Default.aspx page open to both Admin AND regular users. At the moment, if you are a regular user and attempt to access Default.aspx, you'll be rerouted to the "AccessDenied.aspx" page (which is how it should be if they were given a link to any of the other pages).

  1. Is there a way to suppress that functionality within the same site.Master page for just Default.aspx? I would like to stick with 1 master page, and still want to reference the original "site.Master" so that I don't have to duplicate the layout, etc.

  2. If there is, is it also possible to have regular users see only the Default.aspx page with a "Home" link on the menu (while the Admin would see Home, Admin, etc. other tabs for dropdown)?

In the code behind I handle the reroute to the Access Denied page by checking the security role of the user accessing the page. Is there a way to say: "If user is on Default.aspx page, ignore this reroute" ?

Thank you very much for all the help!!

Related posts

Recent Viewed