网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
YoucreateaWebpagenamedTestPage.aspxandausercontrolnamedcontainedinafilenamedTestUserControl.ascx.YouneedtodynamicallyaddTestUserControl.ascxtoTestPage.aspx.Whichcodesegmentshouldyouuse?()

A.protectedvoidPage_Load(objectsender,EventArgse){ControluserControl=Page.LoadControl("TestUserControl.ascx");Page.Form.Controls.Add(userControl);}

B.protectedvoidPage_Load(objectsender,EventArgse){ControluserControl=Page.FindControl("TestUserControl.ascx");Page.Form.Controls.Load(userControl);}

C.protectedvoidPage_PreInit(objectsender,EventArgse){ControluserControl=Page.LoadControl("TestUserControl.ascx");Page.Form.Controls.Add(userControl);}

D.protectedvoidPage_PreInit(objectsender,EventArgse){ControluserControl=Page.FindControl("TestUserControl.ascx");Page.Form.Controls.Load(userControl);}


参考答案

更多 “ YoucreateaWebpagenamedTestPage.aspxandausercontrolnamedcontainedinafilenamedTestUserControl.ascx.YouneedtodynamicallyaddTestUserControl.ascxtoTestPage.aspx.Whichcodesegmentshouldyouuse?() A.protectedvoidPage_Load(objectsender,EventArgse){ControluserControl=Page.LoadControl(TestUserControl.ascx);Page.Form.Controls.Add(userControl);}B.protectedvoidPage_Load(objectsender,EventArgse){ControluserControl=Page.FindControl(TestUserControl.ascx);Page.Form.Controls.Load(userControl);}C.protectedvoidPage_PreInit(objectsender,EventArgse){ControluserControl=Page.LoadControl(TestUserControl.ascx);Page.Form.Controls.Add(userControl);}D.protectedvoidPage_PreInit(objectsender,EventArgse){ControluserControl=Page.FindControl(TestUserControl.ascx);Page.Form.Controls.Load(userControl);} ” 相关考题