Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以从通过管理员网站分配的角色将用户详细信息检索到网格视图中?还有其他方法吗?
您也可以通过在数据库中制作额外的角色列并在登录时提取角色的值来实现相同的目的。
现在您可以将此角色存储在任何类型的变量中,如 cookie、会话等,并在主页面中执行以下检查
if(session[role]==null) { Response.Redirect("Home.aspx"); } else if(session[role]!="User") { Response.Redirect("Home.aspx"); }