简体   繁体   中英

how to create privileges for users in a asp.net website

i have a MS-SQL database with users table and login page and everything, i wanna restrict access to some pages to couple users only.

i want something like this

@if (WebSecurity.privilegs == "administrative")
   view page;
else
   Redirect;

What should i use to implement such a thing ?

** im building asp.net webforms not MVC

You should use the built in ASP.NET Identity and then assign a role your users. You then secure your application based on roles.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM