2012年微软认证考试考前冲刺试题1
09-07
0


QUESTION 1 
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. 
You create a Web page that contains the following two XML fragments. (Line numbers are included for reference only.)  
01   
02  
03   
04 05 DataSourceID="SqlDataSource1"  
06  
07 >  
08   
09   
10 11 Text=’’ />  
12   
13   
The SqlDataSource1 object retrieves the data from a Microsoft SQL Server 2005 database table. The database table has a column named LineTotal. 
You need to ensure that when the size of the LineTotal column value is greater than seven characters, the column is displayed in red color. 
What should you do? 
.Insert the following code segment at line 06. 
OnItemDataBound="FmtClr" Insert the following code segment at line 02. 
protected void FmtClr (object sender, ListViewItemEventArgs e) { 
Label LineTotal = (Label) 
e.Item.FindControl("LineTotalLabel");  
if ( LineTotal.Text.Length > 7)  
{ LineTotal.ForeColor = Color.Red;  }   
else   
{ LineTotal.ForeColor = Color.Black;  }  

B.Insert the following code segment at line 06. 
OnItemDataBound="FmtClr" Insert the following code segment at line 02. 
protected void FmtClr (object sender, ListViewItemEventArgs e) { 
Label LineTotal = (Label) 
e.Item.FindControl("LineTotal");  
if ( LineTotal.Text.Length > 7)  
{LineTotal.ForeColor = Color.Red; }  
else  
{LineTotal.ForeColor = Color.Black; }  

C.Insert the following code segment at line 06. 
OnDataBinding="FmtClr" Insert the following code segment at line 02. 
protected void FmtClr(object sender, EventArgs e) { 
Label LineTotal = new Label();  
LineTotal.ID = "LineTotal";  
if ( LineTotal.Text.Length > 7)  
{LineTotal.ForeColor = Color.Red; }  
else  
{ LineTotal.ForeColor = Color.Black; }  

D.Insert the following code segment at line 06. 
OnDataBound="FmtClr" Insert the following code segment at line 02. 
protected void FmtClr(object sender, EventArgs e) { 
Label LineTotal = new Label();  
LineTotal.ID = "LineTotalLabel";  
if ( LineTotal.Text.Length > 7)  
{LineTotal.ForeColor = Color.Red; }  
else  
{LineTotal.ForeColor = Color.Black; }  


QUESTION 2 
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. 
Your application has a user control named UserCtrl.ascx. You write the following code fragment to create a Web page named Default.aspx.  
 
You need to dynamically add the UserCtrl.ascx control between the lblHeader and lblFooter Label controls.
What should you do?
 
A.Write the following code segment in the Init event of the Default.aspx Web page.
Control ctrl = LoadControl("UserCtrl.ascx"); this.Controls.AddAt(1, ctrl);
B.Write the following code segment in the Init event of the Default.aspx Web page.
Control ctrl = LoadControl("UserCtrl.ascx"); lblHeader.Controls.Add(ctrl);
C.Add a Literal control named Ltrl between the lblHeader and lblFooter label controls.
Write the following code segment in the Init event of the Default.aspx Web page.
Control ctrl = LoadControl("UserCtrl.ascx");
D.Add a PlaceHolder control named PlHldr between the lblHeader and lblFooter label controls.
Write the following code segment in the Init event of the Default.aspx Web page.
Control ctrl = LoadControl("UserCtrl.ascx"); PlHldr.Controls.Add(ctrl);

Answer: D

相关内容

热门资讯

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