多项选择题
You create an ASP.NET page that contains the following tag. Page Name
You need to write code that will change the contents of the tag dynamically when the page is loaded. What are two possible ways to achieve this goal?()
A.this.hdr1.InnerHtml = "Text";
B.(hdr1.Parent as HtmlGenericControl).InnerText = "Text";
C.HtmlGenericControl h1 = this.FindControl("hdr1") as HtmlGenericControl;h1.InnerText = "Text";
D.HtmlGenericControl h1 = Parent.FindControl("hdr1") as HtmlGenericControl;h1.InnerText = "Text";
相关考题
-
单项选择题
You are implementing an ASP.NET page that includes the following drop-down list. You need to dynamically add values to the end of the drop-down list. What should you do? ()
A.Add the following OnPreRender event handler to the asp:DropDownList
B.Add the following OnPreRender event handler to the asp:DropDownList
C.Add the following event handler to the page code-behind.
D.Add the following event handler to the page code-behind. -
多项选择题
You create a custom server control named Task that contains the following code segment. You need to ensure that adding a Task control from the Toolbox creates markup in the following format. Which two actions should you perform?()
A.Add the following code segment to the project’s AssemblyInfo.cs file. [assembly: TagPrefix("DevControls", "Dev")]
B.Replace line 05 with the following code segment. [DefaultValue("New Task")]
C.Insert the following code segment immediately before line 03. [ToolboxData("<{0}:Task runat=\"server\" Title=\"New Task\" />")]
D.Replace line 10 with the following code segment. output.Write("<Dev:Task runat=\"server\" Title=\"New Task\" />"); -
多项选择题
YouusethefollowingdeclarationtoaddaWebusercontrolnamedTestUserControl.ascxtoanASP.NETpagenamedTestPage.aspx.Youaddthefollowingcodetothecode-behindfileofTestPage.aspx.privatevoidTestMethod(){...}Youdefinethefollowingdelegate.publicdelegatevoidMyEventHandler();YouneedtoaddaneventoftypeMyEventHandlernamedMyEventtoTestUserControl.ascxandattachthepage’sTestMethodmethodtotheevent.Whichtwoactionsshouldyouperform?()
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"/>
