I want to use the location path, allow the user and prevent the user from restricting access in my MVC application. This is the section I added in web.config
<location path="Views/Admin/Ticketing/Seasons.aspx"> <system.web> <authorization> <allow users="admin" /> <deny users="user1" /> </authorization> </system.web> </location>
He does not work. non-admin users, such as user1, can view the page. I am not sure if this is because I have the routing setup different or wrong.
This is the URL of the tab I want to block.
http: //marilyndenisservices.localhost/Admin/TicketingSeasons
This is the physical path of this page on disk D: \ DEV \ MarilynDenisServices \ SRC \ Web \ Views \ Admin \ Ticket \ Seasons.aspx
And this is how I tuned it to a view model
<div id="menucontainer"> <ul id="menu"> <li><%= Html.ActionLink("Ticketing", "TicketingSeasons", "Admin") %></li> </ul> </div>
This is my action
public ActionResult TicketingSeasons() { return View("Ticketing/Seasons"); }
Can someone tell me what I'm doing wrong?
authorization web-config asp.net-mvc-4
doglin
source share