多项选择题
You are developing a Web application. The Web application restricts access to an administrative page. The Web application uses the following code segment to protect the page.If Page.User.Identity.Name <> "CONTOSO\Administrator" Then Response.Redirect("login.aspx")End IfYou are logged on as Administrator. When you display the page, you are redirected to Login.aspx. You discover that the User.Identity.Name property is not being correctly populated. You need to ensure that you can access the page when you are logged on as Administrator. Which two actions should you perform? ()
A. In the Web.config file, enable impersonation.
B. In IIS, enable anonymous access.
C. In IIS, disable anonymous access.
D. In the Web.config file, set the authentication mode to Windows.
相关考题
-
单项选择题
You create a Web Form that allows users to create a new account. You add a CreateUserWizard control by using the following code segment. You need to ensure that the wizard automatically sends an e-mail message to users when they finish creating their accounts. You add a valid element to the Web.config file. Which code segment should you add to the Page_Load event? ()
A. Wizard1.RequireEmail = True
B. Wizard1.Email = "user@address.com"
C. Wizard1.MailDefinition.From = "registration@mysite.com"
D. SmtpMail.SmtpServer = "mail.contoso.com" -
单项选择题
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.
