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