因此。我在asp.net webforums有一个网站,事情就是这样。
我可以轻松控制谁可以查看每个页面:
<location path="seetalktous.aspx">
<system.web>
<authorization>
<allow users="admin"/>
<deny users="*" />
</authorization>
</system.web>
</location>
问题是,如果我想让普通用户看到一个页面,但是只有一个文本行会显示给登录者,或者只有按钮会显示给用户(管理员)我该怎么办?那样做?
非常感谢!
答案 0 :(得分:2)
使用LoginView控件。 Read this topic了解如何使用Rolegroups属性为组提供模板。
答案 1 :(得分:0)
相关事件处理程序
中的以下代码如何?if (Request.IsAuthenticated) {
// do something for authenticated users
} else {
// do something for users who are not authenticated
}