2013年微软认证考试精选试题5

牛课网 考试宝典 更新时间:2024-05-12 17:27:13

微软认证题库 微软的认证考试 微软认证考试有哪些

我们考吧网为了帮助考生朋友们加强基础知识的巩固,加强练习试题的训练,有效的提高学习效率,我们考吧网整理了一些关于微软认证模拟试题,希望对本次的考试有所帮助,汇编的模拟试题如下:同时也希望你本次顺利通关。想了解更多职称计算机咨询,就请继续关注我们考吧网。

1.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.

’ />

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;

答案: B

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

You write the following code segment to create a JavaScript file named CalculatorScript.js.

function divide(a, b) {

if (b == 0) {

var errorMsg = Messages.DivideByZero;

alert(errorMsg); return null;

}

return a/b;

}

You embed the CalculatorScript.js file as a resource in a Class Library project.

The namespace for this project is Calculator.Resources.

The JavaScript function retrieves messages from a resource file named MessageResources.resx by using the JavaScript Messages object.

You add an AJAX Web form in the ASP.NET application. You reference the Class Library in the application.

You add an ASP.NET AJAX ScriptReference element to the AJAX Web form.

You need to ensure that the JavaScript function can access the error messages that are defined in the resource file.

Which code segment should you add in the AssemblyInfo.cs file?

A.[assembly: ScriptResource ("CalculatorScript", "MessageResources", "Messages")]

B.[assembly: ScriptResource ("CalculatorScript.js", "MessageResources.resx", "Messages")]

C.[assembly: ScriptResource ("Calculator.Resources.CalculatorScript.js", "Calculator.Resources.MessageResources", "Messages")]

D.[assembly: ScriptResource ("Calculator.Resources.CalculatorScript", "Calculator.Resources.MessageResources.resx", "Messages")]

答案: C

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

You create two user controls named UserCtrlA.ascx and UserCtrlB.ascx. The user controls postback to the server.

You create a new Web page that has the following ASPX code.

To dynamically create the user controls, you write the following code segment for the Web page.

public void LoadControls() {

if (ViewState["CtrlA"] != null) {

Control c; if ((bool)ViewState["CtrlA"] == true) {

c = LoadControl("UserCtrlA.ascx");

} else

{

c = LoadControl("UserCtrlB.ascx");

}

c.ID = "Ctrl"; PlHolder.Controls.Add(c); }

}

protected void Chk_CheckedChanged(object sender, EventArgs e)

{

ViewState["CtrlA"] = Chk.Checked; PlHolder.Controls.Clear(); LoadControls();

}

You need to ensure that the user control that is displayed meets the following requirements:

It is recreated during postback It retains its state.

Which method should you add to the Web page?

A.protected override object SaveViewState() {

LoadControls(); return base.SaveViewState(); }

B.protected override void Render(HtmlTextWriter writer) {

LoadControls(); base.Render(writer); }

C.protected override void OnLoadComplete(EventArgs e) {

base.OnLoadComplete(e); LoadControls(); }

D.protected override void LoadViewState(object savedState) {

base.LoadViewState(savedState); LoadControls(); }

答案: D

编辑推荐:

2013年微软认证考前模拟精选试题汇总二

2013年微软认证考试精选试题汇总三

考试宝典安装说明

宝典适用于手机、电脑、平板,您可安装客户端或在浏览器使用。

电脑版

手机版

网页版

考试宝典咨询
服务热线

TEL:029-88699698