Killtest题库

专业IT认证题库学习资料,助您通过IT认证考试!

« 最新的000-085题库免费下载!killtest题库网提供最新的642-902题库下载! »

killtest题库网免费提供最新的70-562题库下载!

MCTS 70-562考试题库由我们专业IT认证讲师及产品专家精心打造,包括了当前最新的全真试题,全部附有正确答案。题库的覆盖率在96%以上,在考生认证厂商对考题做出变化时,网站都将在第一时间内更新题库,确保考生能一次pass

 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 <script runat="server">

02

03 </script>

04 <asp:ListView ID="ListView1" runat="server"

05 DataSourceID="SqlDataSource1"

06

07 >

08 <ItemTemplate>

09 <td>

10 <asp:Label ID="LineTotalLabel" runat="server"

11 Text='<%# Eval("LineTotal") %>' />

12 </td>

13 </ItemTemplate>

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?

A. 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; }

}

Answer: A

2. 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 <script runat="server">

02

03 </script>

04 <asp:ListView ID="ListView1" runat="server"

05 DataSourceID="SqlDataSource1"

06

07 >

08 <ItemTemplate>

09 <td>

10 <asp:Label ID="LineTotalLabel" runat="server"

11 Text='<%# Eval("LineTotal") %>' />

12 </td>

13 </ItemTemplate>

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?

A. Insert the following code segment at line 06.

OnItemDataBound="FmtClr"

Insert the following code segment at line 02.

Protected Sub FmtClr(ByVal sender As Object, _ByVal e As ListViewItemEventArgs)

Dim LineTotal As Label = _

DirectCast(e.Item.FindControl("LineTotalLabel"), Label)

If LineTotal IsNot Nothing Then

If LineTotal.Text.Length > 7 Then

LineTotal.ForeColor = Color.Red

Else

LineTotal.ForeColor = Color.Black

End If

End If

End Sub

B. Insert the following code segment at line 06.

OnItemDataBound="FmtClr"

Insert the following code segment at line 02.

Protected Sub FmtClr(ByVal sender As Object, _ByVal e As ListViewItemEventArgs)

Dim LineTotal As Label = _

DirectCast(e.Item.FindControl("LineTotal"), Label)

If LineTotal.Text.Length > 7 Then

LineTotal.ForeColor = Color.Red

Else

LineTotal.ForeColor = Color.Black

End If

End Sub

C. Insert the following code segment at line 06.

OnDataBinding="FmtClr"

Insert the following code segment at line 02.

Protected Sub FmtClr(ByVal sender As Object, _ByVal e As EventArgs)

Dim LineTotal As New Label()

LineTotal.ID = "LineTotal"

If LineTotal.Text.Length > 7 Then

LineTotal.ForeColor = Color.Red

Else

LineTotal.ForeColor = Color.Black

End If

End Sub

D. Insert the following code segment at line 06.

OnDataBound="FmtClr"

Insert the following code segment at line 02.

Protected Sub FmtClr(ByVal sender As Object, _ByVal e As EventArgs)

Dim LineTotal As New Label()

LineTotal.ID = "LineTotalLabel"

If LineTotal.Text.Length > 7 Then

LineTotal.ForeColor = Color.Red

Else

LineTotal.ForeColor = Color.Black

End If

End Sub

Answer: A

3. You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.

You create a Web form and add the following code fragment.

<asp:Repeater ID="rptData" runat="server"

DataSourceID="SqlDataSource1"ItemDataBound="rptData_ItemDataBound">

<ItemTemplate>

<asp:Label ID="lblQuantity" runat="server"

Text='<%# Eval("QuantityOnHand") %>' />

</ItemTemplate>

</asp:Repeater>

The SqlDataSource1 DataSource control retrieves the Quantity column values from a table named

Products.

You write the following code segment to create the rptData_ItemDataBound event handler. (Line numbers

are included for reference only.)

01 protected void rptData_ItemDataBound(object sender,

02 RepeaterItemEventArgs e)

03 {

04

05 if(lbl != null)

06 if(int.Parse(lbl.Text) < 10)

07 lbl.ForeColor = Color.Red;

08 }

You need to retrieve a reference to the lblQuantity Label control into a variable named lbl.

Which code segment should you insert at line 04?

A. Label lbl = Page.FindControl("lblQuantity") as Label;

B. Label lbl = e.Item.FindControl("lblQuantity") as Label;

C. Label lbl = rptData.FindControl("lblQuantity") as Label;

D. Label lbl = e.Item.Parent.FindControl("lblQuantity") as Label;

Answer: B

如需下载更多的题库,请登录killtest题库网

 

 

 

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最近发表

Powered By Z-Blog 1.8 Arwen Build 81206

Copyright xxxx-xxxx Your WebSite. Some Rights Reserved.