Monday, January 09, 2006
How to control access to specific pages based on authorizationAt any point in the applicaiton, one can do the following...IPrincipal usr = HttpContext.Current.User If (usr.IsInRole("Admin") == false) Response.Redirect("AccessDenied.aspx"); //usr.Identity.Name gives the logged in user id. If wanted The above can be put in "Page_Load" event (or, OnLoad event) of the aspxs page to restrict control. |
About Me
LinksPrevious Posts
Archives |
0 Comments:
Post a Comment
<< Home