Restricted access for usercontrol by role
is possible to limit access for particular usercontrol for particular role?
I have page (default.aspx) 开发者_高级运维that load (also) info.ascx
I wanto to restricted access to info.ascx and display a message like 'unauthorized' where he was to be loaded.
thanks!
There is nothing inbuilt in ASP.Net. You would have to implement your own access control using the Role providers and Custom user controls.
You can use
<authorization>
<allow users="user1, user2"/>
<deny users=”?”/>
</authorization>
This article may help: http://www.codeproject.com/Articles/301324/Authorization-in-ASP-NET
精彩评论