2012年微软认证考试考前冲刺试题12
09-10
0



QUESTION 22
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a custom Web user control named SharedControl. The control will be compiled as a library.
You write the following code segment for the SharedControl control. (Line numbers are included for reference only.) 
01 protected override void OnInit(EventArgs e) 
02 { 
03 base.OnInit(e); 
04 
05 } 
All the master pages in the ASP.NET application contain the following directive.
<%@ Master Language="C#" EnableViewState="false" %> 
You need to ensure that the state of the SharedControl control can persist on the pages that reference a master page.
Which code segment should you insert at line 04?
 
A.Page.RegisterRequiresPostBack(this);
B.Page.RegisterRequiresControlState(this);
C.Page.UnregisterRequiresControlState(this);
D.Page.RegisterStartupScript("SharedControl","server");

Answer: B

QUESTION 23
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a page that contains the following code fragment.
 
 
You write the following code segment in the code-behind file for the page.
    void BindData(object sender, EventArgs e) { 
        lstLanguages.DataSource = CultureInfo.GetCultures(CultureTypes.AllCultures); 
        lstLanguages.DataTextField = "EnglishName"; lstLanguages.DataBind(); 
    }
 
You need to ensure that the lstLanguages ListBox control maintains the selection of the user during postback.
Which line of code should you insert in the constructor of the page?
 
A.this.Init += new EventHandler(BindData);
B.this.PreRender += new EventHandler(BindData);
C.lstLanguages.PreRender += new EventHandler(BindData);
D.lstLanguages.SelectedIndexChanged += new EventHandler(BindData);

Answer: A
 

相关内容

热门资讯

2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题8
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题6
微软认证考试基于.NET的We... 微软认证考试基于.NET的Web应用程序开发模拟试题四
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题4
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题5
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题10
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试经典试题2
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试经典试题7
2012年微软认证考试备考模拟... 2012年微软认证考试备考模拟试题5
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试经典试题1