CMS专题

单选题You create an ASP.NET page named TestPage.aspx that contains validation controls. You need to verify that all input values submitted by the user have been validated by testing the Page.IsValid property. Which page event should add an event handler to?(

题目
单选题
You create an ASP.NET page named TestPage.aspx that contains validation controls. You need to verify that all input values submitted by the user have been validated by testing the Page.IsValid property. Which page event should add an event handler to?()
A

Ini

B

Load

C

PreInit

D

PreLoad

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

第1题:

You work as a Web Developer at Certkiller.com. You are in the process of creating a Webapplication using Microsoft ASP.NET 3.5.  You create a folder named Dark in the App_Themes folder of the Web application. You also addfour skin files to this folder. You have to make sure that the controls on a page have their appearances overridden by the control definitions defined in the skin files. What should you do?  Which Page directive should you use?()

  • A、You should use the page directive: <%@ Page StyleSheetTheme="App_Themes.Dark"/>
  • B、You should use the page directive: <%@ Page Theme="App_Themes.Dark"/>
  • C、You should use the page directive: <%@ Page Theme="Dark"/>
  • D、You should use the page directive: <%@ Page StyleSheetTheme="Dark"/>

正确答案:C

第2题:

You create a Web page named TestPage.aspx and a user control named contained in a file named TestUserControl.ascx.You need to dynamically add TestUserControl.ascx to TestPage.aspx. Which code segment should you use?()

  • A、protected void Page_Load(object sender, EventArgs e) { Control userControl=Page.LoadControl("TestUserControl.ascx"); Page.Form.Controls.Add(userControl); }
  • B、protected void Page_Load(object sender, EventArgs e) { Control userControl = Page.FindControl("TestUserControl.ascx"); Page.Form.Controls.Load(userControl); }
  • C、protected void Page_PreInit(object sender, EventArgs e) { Control userControl =Page.LoadControl("TestUserControl.ascx");Page.Form.Controls.Add(userControl); }
  • D、protected void Page_PreInit(object sender, EventArgs e) { Control userControl = Page.FindControl("TestUserControl.ascx"); Page.Form.Controls.Load(userControl); }

正确答案:C

第3题:

You create a master page named PageBase.master. The master page contains a Label control named lblTitle.You create a content page that references the master page.You need to change the Text property of the master page‘s lblTitle control from the content page.Which code segment should you use?()

A.

B.

C.

D.


参考答案:A

第4题:

You create a Web page named TestPage.aspx and a user control named TestUserControl.ascx. TestPage.aspx uses TestUserControl.ascx as shown in the following line of code. On TestUserControl.ascx, you need to add a read-only member named CityName to return the value "New York". You also must add code to TestPage.aspx to read this value. Which two actions should you perform?()

  • A、Add the following line of code to the TestUserControl.ascx.cs code-behind file. public string CityName { get { return "New York"; } } 
  • B、Add the following line of code to the TestUserControl.ascx.cs code-behind file. protected readonly string CityName = "New York"; 
  • C、Add the following code segment to the TestPage.aspx.cs code-behind file. protected void Page_Load(object sender, EventArgs e) { string s = testControl.CityName; } 
  • D、Add the following code segment to the TestPage.aspx.cs code-behind file. protected void Page_Load(object sender, EventArgs e) { string s = testControl.Attributes["CityName"]; } 

正确答案:A,C

第5题:

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.  You create a custom Web user control named SharedControl. The control will be compiled as a library.  You write the following code segment for the SharedControl control. (Line numbers are included for  reference only.)  01 protected override void OnInit(EventArgs e) 02 {  03 base.OnInit(e);  04  05 }  All the master pages in the ASP.NET application contain the following directive.  <%@ Master Language="C#" EnableViewState="false" %>  You need to ensure that the state of the SharedControl control can persist on the pages that reference a  | English | Chinese | Japan | Korean | - 87 - Test Information Co., Ltd. All rights reserved. master page.  Which code segment should you insert at line 04?()

  • A、Page.RegisterRequiresPostBack(this);
  • B、Page.RegisterRequiresControlState(this);
  • C、Page.UnregisterRequiresControlState(this);
  • D、Page.RegisterStartupScript("SharedControl","server");

正确答案:B

第6题:

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a page that contains the following code fragment:       You write the following code segment in the code-behind file for the page:   void BindData(object sender, EventArgs e) {   lstLanguages.DataSource =  CultureInfo.GetCultures(CultureTypes.AllCultures);   lstLanguages.DataTextField = "EnglishName";  lstLanguages.DataBind();   }   You need to ensure that the lstLanguages ListBox control maintains the selection of the user during postback.  Which line of code should you insert in the constructor of the page?()

  • A、this.Init += new EventHandler(BindData); 
  • B、this.PreRender += new EventHandler(BindData); 
  • C、lstLanguages.PreRender += new EventHandler(BindData); 
  • D、lstLanguages.SelectedIndexChanged += new EventHandler(BindData);

正确答案:A

第7题:

You are implementing an ASP.NET application that includes a page named TestPage.aspx. TestPage.aspx uses a master page named TestMaster.master.You add the following code to the TestPage.aspx code-behind file to read a TestMaster.master public property named CityName. Protected Sub Page_Load(ByVal sender As Object,ByVal e As System.EventArgs) Handles Me.LoadDim s As String = Master.CityNameEnd Sub  You need to ensure that TestPage.aspx can access the CityName property. What should you do?()

  • A、Add the following directive to TestPage.aspx. <%@ MasterType VirtualPath="~/TestMaster.master" %> 
  • B、Add the following directive to TestPage.aspx. <%@ PreviousPageType VirtualPath="~/TestMaster.master" %> 
  • C、Set the Strict attribute in the @ Master directive of the TestMaster.master page to true. 
  • D、Set the Explicit attribute in the @ Master directive of the TestMaster.master page to true. 

正确答案:A

第8题:

You create an ASP.NET page named TestPage.aspx that contains validation controls. You need to verify that all input values submitted by the user have been validated by testing the Page.IsValid property. Which page event should you add an event handler to?()

  • A、Init
  • B、Load
  • C、PreInit
  • D、PreLoad

正确答案:B

第9题:

You are developing an ASP.NET Web application. You create a master page. The master page requires a region where you can add page-specific content by using the ASP.NET page designer.  You need to add a control to the master page to define the region. Which control should you add?()

  • A、Content
  • B、ContentPlaceHolder
  • C、PlaceHolder
  • D、Substitution

正确答案:B

第10题:

You create a master page named Article.master. Article.master serves as the template for articles on your Web site. The master page uses the following page directives. <%@ Master Language="VB" CodeFile="article.master.vb" Inherits="article" %> You need to create a content page that uses the master page as a template. In addition, you need to use a single master page for all devices that access the Web site. Which code segment should you use? ()

  • A、<%@ Page Language="VB" Theme="article"%>
  • B、<%@ Page Language="VB" MasterPageFile="~/article.master"%>
  • C、<%@ Page Language="VB" ie:MasterPageFile="~/article.master"%>
  • D、<%@Page Language="VB" all:MasterPageFile="~/article.master"%>

正确答案:B

更多相关问题