单项选择题
You create a Web site that is for members only. The Web site allows members to create lists of users that have access to information about member profiles. The name of the list is stored in the listName variable. The user name of the user to whom access is given is stored in the username variable. You need to enable members to manage their lists of users. Which code segment should you use? ()
A. Roles.CreateRole(listName)User.IsInRole(listName)
B. Roles.CreateRole(listName)Roles.AddUserToRole(userName, listName)
C. Roles.RoleExists(listName)Roles.AddUserToRole(userName, listName)
D. Roles.RoleExists(listName)User.IsInRole(listName)
相关考题
-
单项选择题
You create a Web site with membership and personalization enabled. You must use an existing CRM database for storing the membership information. You need to implement the Membership Provider. What should you do? ()
A. Modify the connection string in the Web.config file to connect to the CRM database.
B. Add new a SqlMembershipProvider to the Web.config file.
C. Create a custom Membership Provider inheriting from MembershipProvider.
D. Create a custom MembershipUser inheriting from MembershipUser. -
单项选择题
You deploy your companys Internet Web site. You need to deny anonymous access to the Web site, allowing only authenticated users. Which code segment should you use?()
A. <authorization> <allow users="?"/> </authorization>
B. <authorization> <deny users="?"/> </authorization>
C. <authorization> <deny users="*"/></authorization>
D. <authorization> <allow users="*"/> </authorization> -
单项选择题
You create an intranet Web site for management of project documents. You need to enable all users to browse documents on the site. Only members of the administrators group must be able to upload files. Which code segment of the Web.config file should you use? ()
A. <allow verbs="GET" users="*" /><deny verbs="POST" users="*" /><allow verbs="POST" roles="Administrators" />
B. <allow roles="Administrators" /><deny users="*" />
C. <allow u sers="Administrators" /><allow users="*" />
D. <allow v erbs = "POST" roles="Administrators" /><deny verbs="POST" users="*" /><allow verbs="GET" users="*" />
