单选题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?()Aprotected void Page_Load(object sender, EventArgs e) { Control userControl=Page.LoadControl(TestUserControl.ascx); Page.Form.Controls.Add(userControl); }Bprotected void Page_Load(object sender, EventArgs e) { Control userControl = Page.FindControl(TestUserControl.ascx); Page.Form.Controls.Load(userControl); }Cprotected void Page_PreInit(object sender, EventArgs e) { Control userControl =Page.LoadControl(TestUserControl.ascx);Page.Form.Controls.Add(userControl); }Dprotected void Page_PreInit(object sender, EventArgs e) { Control userControl = Page.FindControl(TestUserControl.ascx); Page.Form.Controls.Load(userControl); }

单选题
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); }


参考解析

解析: 暂无解析

相关考题:

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. BehaviorEditorPartB. AppearanceEditorPartC. PropertyGridEditorPartD. LayoutEditorPart

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.

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、InitB、LoadC、PreInitD、PreLoad

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"/

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); }

You create a Web server control named ContosoControls. You add a Web custom control named ContosoMailer to it. You then distribute the Web Control Library files to your team. You need to provide your team with the correct procedure for adding the Web Control Library to the items in the toolbox of Microsoft Visual Studio .NET. Which procedure should you provide to the team?()A、Within the toolbox, click Choose Items and then browse to and select the ContosoControls user control.B、Within the toolbox, click Choose Items and then browse to and select the ContosoMailer user control.C、Right-click Web Project, click Add Reference, and then browse to and select the ContosoControls.dll file.D、Within the toolbox, click Choose Items and then browse to and select the ContosoControls.dll file.

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.

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");

You create a control named ContosoUI for a Web application. You need to add the control to the toolbox of Microsoft Visual Studio .NET. Which two actions should you perform?()A、Create the ContosoUI control as a Web Control Library.B、Create the ContosoUI control as a Web user control.C、Within the Visual Studio .NET toolbox, browse to and select ContosoUI.ascx.D、Within the Visual Studio .NET toolbox, browse to and select ContosoUI.dll.

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"]; }

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 theASP.NET page designer. You need to add a control to the master page to define the region. Which control should you add?()A、PlaceHolderB、ContentPlaceHolderC、ContentD、Substituition

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、BehaviorEditorPartB、AppearanceEditorPartC、PropertyGridEditorPartD、LayoutEditorPart

You work as an ASP.NET Web Application Developer for SomeCompany.  The company uses Visual Studio .NET 2010 as its application development platform. You create an ASP.NET Web application using .NET Framework 4.0. You create a Web page in the application. The Web page will get large sets of data from a data source.  You add a DataPager control to the page. You are required to display navigation controls that enable you to create a custom paging Ul for the DataPager control. What will you do?()A、Use NextPreviousPagerField.B、Use NumericPagerField.C、Use PreviousPagerField.D、Use NextPagerField.E、Use TemplatePagerField.

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 Overloads Overrides Sub OnInit(ByVal e As EventArgs)  02 MyBase.OnInit(e)  03  04 End Sub  All the master pages in the ASP.NET application contain the following directive.  %@ Master Language="VB" EnableViewState="false" %  You need to ensure that the state of the SharedControl control can persist on the pages that reference a master page.  Which code segment should you insert at line 03?()A、Page.RegisterRequiresPostBack(Me)B、Page.RegisterRequiresControlState(Me)C、Page.UnregisterRequiresControlState(Me)D、Page.RegisterStartupScript("SharedControl", "server")

You use the following declaration to add a Web user control named TestUserControl.ascx to an ASP.NET page named TestPage.aspx.    You add the following code to the code-behind file of TestPage.aspx.  private void TestMethod(){ ...}You define the following delegate.  public delegate void MyEventHandler();  You need to add an event of type MyEventHandler named MyEvent to TestUserControl.ascx and attach the page’s TestMethod method to the event. Which two actions should you perform?()A、Add the following line of code to TestUserControl.ascx.cs. public event MyEventHandler MyEvent;B、Add the following line of code to TestUserControl.ascx.cs. public MyEventHandler MyEvent;C、Replace the TestUserControl.ascx reference in TestPage.aspx with the following declaration. uc:TestUserControl ID="testControl" runat="server" OnMyEvent="TestMethod"/D、Replace the TestUserControl.ascx reference in TestPage.aspx with the following declaration. uc:TestUserControl ID="testControl" runat="server" MyEvent="TestMethod"/

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: 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 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");

You are implementing an ASP.NET Web application. Users will authenticate to the application with an ID. The application will allow new users to register for an account. The application will generate an ID for the user based on the users full name. You need to implement this registration functionality. Which two actions should you perform?()A、Configure the SqlMembershipProvider in the web.config file.B、Configure the SqlProfileProvider in the web.config file.C、Create an ASP.NET page that contains a default CreateUserWizard control to create a new user account.D、Create an ASP.NET page that contains a custom form that collects the user information and then uses the Membership.CreateUser method to create a new user account.

单选题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?()AIniBLoadCPreInitDPreLoad

多选题You are implementing an ASP.NET Web application. Users will authenticate to the application with an ID. The application will allow new users to register for an account. The application will generate an ID for the user based on the users full name. You need to implement this registration functionality. Which two actions should you perform?()AConfigure the SqlMembershipProvider in the web.config file.BConfigure the SqlProfileProvider in the web.config file.CCreate an ASP.NET page that contains a default CreateUserWizard control to create a new user account.DCreate an ASP.NET page that contains a custom form that collects the user information and then uses the Membership.CreateUser method to create a new user account.

单选题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: 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.     You need to ensure that the state of the SharedControl control can persist on the pages that reference a master page.  Which code segment should you insert at line 04?()APage.RegisterRequiresPostBack(this); BPage.RegisterRequiresControlState(this); CPage.UnregisterRequiresControlState(this); DPage.RegisterStartupScript(SharedControl,server);

多选题You create a control named ContosoUI for a Web application. You need to add the control to the toolbox of Microsoft Visual Studio .NET. Which two actions should you perform?()ACreate the ContosoUI control as a Web Control Library.BCreate the ContosoUI control as a Web user control.CWithin the Visual Studio .NET toolbox, browse to and select ContosoUI.ascx.DWithin the Visual Studio .NET toolbox, browse to and select ContosoUI.dll.

单选题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?()AYou should use the page directive: %@ Page StyleSheetTheme=App_Themes.Dark/BYou should use the page directive: %@ Page Theme=App_Themes.Dark/CYou should use the page directive: %@ Page Theme=Dark/DYou should use the page directive: %@ Page StyleSheetTheme=Dark/