单项选择题
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 are implementing an ASP.NET application that will use session state in out-of-proc mode. You add the following code. You need to add an attribute to the Person class to ensure that you can save an instance to session state. Which attribute should you use?()
单项选择题 You are implementing an ASP.NET Web site. The site allows users to explicitly choose the display language for the sites Web pages. You create a Web page that contains a DropDownList named ddlLanguage, as shown in the following code segment. The site contains localized resources for all page content that must be translated into the language that is selected by the user. You need to add code to ensure that the page displays content in the selected language if the user selects a language in the drop-down list. Which code segment should you use?()
单项选择题 You are creating an ASP.NET Web site. The site has a master page named Custom.master. The code-behind file for Custom.master contains the following code segment. You create a new ASP.NET page and specify Custom.master as its master page. You add a Label control named lblRegion to the new page. You need to display the value of the master page’s Region property in lblRegion. What should you do? ()