多做题,通过考试没问题!

微软认证考试

睦霖题库>其他计算机考试>微软认证考试

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"/>
正确答案:A,C
答案解析:
进入题库查看解析

微信扫一扫手机做题