ASP.NET用户角色问题 [英] ASP.NET User Role Problem

查看:76
本文介绍了ASP.NET用户角色问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.

我对网页设计和使用asp.net相对较新.我在使用用户角色时遇到困难.

我有一个管理员和一个秘书,秘书需要访问单个网页中的所有信息和文本框,而管理员只能访问修改该特定网页上的某些信息.管理员必须仍然能够查看其余信息.我当时正在考虑为管理员启用其他信息.

请提供任何帮助.
Thanx

Hi there.

I''m relatively new to web design and using asp.net. I''m having difficulties with user roles.

I have an administrator and a secretary and the secretary needs to access all information and textboxes in a single web page whereas the administrator must only have access to amend certain information on that particular web page. The administrator must still be able to view the rest of the information. I was thinking of enabling the other information for the administrator.

Any help would do, please.
Thanx

推荐答案

是的,在您的代码隐藏内容中可以找到类似的方法.
Yes, something like this in your code-behind would be way to do it.
control.Enabled = IsInRole("Administrator");


LoginView [^ ]允许您根据用户的身份验证状态和角色成员身份,为给定的用户显示适当的内容模板.页面底部有一些示例.

最好的问候
Espen Harlinn
LoginView[^] allows you to display appropriate content template for a given user, based on the user''s authentication status and role membership. There are some examples at the bottom of the page.

Best regards
Espen Harlinn


检查这些博客
http://weblogs. asp.net/scottgu/archive/2006/05/07/ASP.NET-2.0-Membership-and-Roles-Tutorial-Series.aspx [ http://msdn.microsoft.com/en-us/library/ff647401.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/5k850zwb.aspx [ ^ ]
--NDK
check these blogs
http://weblogs.asp.net/scottgu/archive/2006/05/07/ASP.NET-2.0-Membership-and-Roles-Tutorial-Series.aspx[^]
http://msdn.microsoft.com/en-us/library/ff647401.aspx[^]
http://msdn.microsoft.com/en-us/library/5k850zwb.aspx[^]
--NDK


这篇关于ASP.NET用户角色问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆