You are creating an ASP.NET Web site. The site is configured

题目
单选题
You are creating an ASP.NET Web site. The site is configured to use Membership and Role management providers. You need to check whether the currently logged-on user is a member of a role namedAdministrators. Which code segment should you use?()
A

bool isMember = Roles.GetUsersInRole(Administrators).Any()

B

bool isMember = Membership.ValidateUser(User.Identity.Name, Administrators)

C

bool isMember = Roles.GetRolesForUser(Administrators).Any()

D

bool isMember = User.IsInRole(Administrators)

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Your company has an Active Directory domain. All computers are members of the domain. Your networkcontains an internal Web site that uses Integrated Windows Authentication. From a computer that runs Windows 7, you attempt to connect to the Web site and are prompted for authentication. You verify that youruser account has permission to access the Web site. You need to ensure that you are automaticallyauthenticated when you connect to the Web site.  What should you do?()

  • A、Create a complex password for your user account.
  • B、Open Credential Manager and modify your credentials.
  • C、Add the URL of the Web site to the Trusted sites zone.
  • D、Add the URL of the Web site to the Local intranet zone.

正确答案:D

第2题:

You create a Web site. The Web site has many predefined roles and associated users that will be used for security purposes. You need to manage these roles and user accounts. Which tool should you use? ()

  • A、the Microsoft .NET Framework Configuration tool
  • B、the Code Access Security Policy tool
  • C、the ASP.NET IIS Registration tool
  • D、the Web Site Administration Tool

正确答案:D

第3题:

You create a Web site. You add an EditorZone control to the home page on the Web site. You need to enable users to customize the size and location of the Web Parts on their home pages.Which two controls should you add to the EditorZone control?()

A. BehaviorEditorPart

B. AppearanceEditorPart

C. PropertyGridEditorPart

D. LayoutEditorPart


参考答案:B, D

第4题:

You create a Web site. You add an EditorZone control to the home page on the Web site. You need to enable users to customize the size and location of the Web Parts on their home pages. Which two controls should you add to the EditorZone control?()

  • A、BehaviorEditorPart
  • B、AppearanceEditorPart
  • C、PropertyGridEditorPart
  • D、LayoutEditorPart

正确答案:B,D

第5题:

You are an IIS Web server administrator implementing authentication settings for a new Web site.According to the requirements for the Human Resources Web site, users should be prompted forauthentication information when they attempt to access the site. The site will be accessed only by userswho have accounts in your organization’s Active Directory domain. You have already configured the filesystem permissions for the content based on the appropriate settings. You also want to maximize securityof the site. Which two actions should you take to meet these requirements?()

  • A、Enable Windows authentication.
  • B、Enable basic authentication.
  • C、Disable anonymous authentication.
  • D、Enable anonymous authentication.

正确答案:A,C

第6题:

You copy a Web site from a development site to a staging site. You do not have the Web site in a source control application. Another developer begins to fix bugs on the staging site while the development team adds features on the development site. You need to synchronize the development site and the staging site and copy the latest version of each file to both locations. What should you do? ()

  • A、Use the Copy Web tool.
  • B、Create a Web Setup project.
  • C、Use the Publish Web tool.
  • D、Use the command line to XCOPY the files.

正确答案:A

第7题:

You are creating a custom user control. The custom user control will be used on 10 Web Forms for an ASP.NET Web site that allows users to register and log on to a personalized experience. The custom user control uses two TextBox controls and two Button controls. You need to ensure that the controls are visible only when users are not logged on to the Web site. You also need to minimize the amount of effort in development and maintenance for the Web site. Which two actions should you perform? ()

  • A、Add the OnClick event handler for the Login button to the code used in the custom user control.
  • B、Add the OnClick event handler for the Login button to the code used in the Web Form where the control is added.
  • C、In the Page_Load method of the Web Form, add a code segment to set the visibility of the TextBox and Button controls where the control is added.
  • D、In the Page_Load method of the custom user control, add a code segment to set the visibility of the TextBox and Button controls.

正确答案:A,D

第8题:

You create a Web site for a customer. You need to deploy the Web site to the customers server without any of the source files for the Web site. You do not want the customer to be able to update any of the static pages on the Web site.Which tool should you use?()

A. aspnet_compiler.exe

B. InstallUtil.exe

C. CSC.exe

D. aspnet_wp.exe


参考答案:A

第9题:

You create a Web site for a customer. You need to deploy the Web site to the customers server without any of the source files for the Web site. You do not want the customer to be able to update any of the static pages on the Web site. Which tool should you use? ()

  • A、aspnet_compiler.exe
  • B、InstallUtil.exe
  • C、CSC.exe
  • D、aspnet_wp.exe

正确答案:A

第10题:

You are creating an ASP.NET Web site. The site contains pages that are available to anonymous users. The site also contains a page named Premium.aspx that provides premium content to only members of a group named Subscribers. You need to modify the web.config file to ensure that Premium.aspx can be accessed by only members of the Subscribers group. Which configuration should you use?()

  • A、<location path="Premium.aspx"> <system.web> <authorization> <allow users="Subscribers"/>            <deny users="*"/> </authorization> </system.web> </location> 
  • B、<location path="Premium.aspx"> <system.web> <authorization> <allow roles="Subscribers"/>             <deny users="*"/> </authorization> </system.web> </location> 
  • C、<location path="Premium.aspx"> <system.web> <authorization> <allow roles="Subscribers"/>             <deny users="?"/> </authorization> </system.web> </location> 
  • D、<location path="Premium.aspx"> <system.web> <authorization> <deny users="*"/> <allow roles="Subscribers"/> </authorization> </system.web> </location>

正确答案:B

更多相关问题