為大家收集整理了《2013微軟認證考試練習題及答案(21)》供大家參考,希望對大家有所幫助?。。?BR> QUESTION 21
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You plan to add a custom parameter in the SqlDataSource control.
You write the following code fragment.
You write the following code segment to create a custom parameter class.
public class DayParameter : Parameter { }
You need to ensure that the custom parameter returns the current date and time.
Which code segment should you add to the DayParameter class?
A.protected DayParameter() : base("Value", TypeCode.DateTime, DateTime.Now.ToString()) {
}
B.protected override void LoadViewState(object savedState) {
((StateBag)savedState).Add("Value", DateTime.Now); }
C.protected override object Evaluate(HttpContext context, Control control) { return DateTime.Now; }
D.protected override Parameter Clone() {
Parameter pm = new DayParameter(); pm.DefaultValue = DateTime.Now; return pm; }
Answer: C
QUESTION 22 You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application has an ASPX page named ErrorPage.aspx. You plan to manage the unhandled application exceptions. You need to perform the following tasks: Display the ErrorPage.aspx page Write the exceptioninformation in the Event log file. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A.Add the following code fragment to the Web.config file.
B.Add the following code fragment to the Web.config file.
C.Add the following code segment to the Global.asax file.
void Application_Error(object sender, EventArgs e)
{
Exception exc = Server.GetLastError();
//Write Exception details to event log
}
D.Add the following code segment to the ErrorPage.aspx file.
void Page_Error(object sender, EventArgs e)
{
Exception exc = Server.GetLastError();
//Write Exception details to event log
Server.ClearError();
}
Answer: AC
QUESTION 23
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application contains two Web pages named OrderDetails.aspx and OrderError.htm.
If the application throws unhandled errors in the OrderDetails.aspx Web page, a stack trace is displayed to remote users.
You need to ensure that the OrderError.htm Web page is displayed for unhandled errors only in the OrderDetails.aspx Web page.
What should you do?
A.Set the Page attribute for the OrderDetails.aspx Web page in the following manner.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OrderDetails.aspx.cs" Inherits="OrderDetails" %>
Add the following section to the Web.config file.
B.Set the Page attribute for the OrderDetails.aspx Web page in the following manner.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OrderDetails.aspx.cs" Inherits="OrderDetails" Debug="true" %>
Add the following section to the Web.config file.
C.Set the Page attribute for the OrderDetails.aspx Web page in the following manner.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OrderDetails.aspx.cs" Inherits="OrderDetails" ErrorPage="~/OrderError.htm" Debug="false" %>
Add the following section to the Web.config file.
D.Set the Page attribute for the OrderDetails.aspx Web page in the following manner.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OrderDetails.aspx.cs" Inherits="OrderDetails" Debug="true" ErrorPage="~/OrderError.htm" %>
Add the following section to the Web.config file.
Answer: C QUESTION 24 You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You write the following code fragment.
You need to ensure that when you click the btnSubmit Button control, each Label control value is asynchronously updatable.
Which code segment should you use?
A.protected void btnSubmit_Click(object sender, EventArgs e) {
Label1.Text = "Label1 updated value";
Label2.Text = "Label2 updated value";
Label3.Text = "Label3 updated value";
}
B.protected void btnSubmit_Click(object sender, EventArgs e) {
Label1.Text = "Label1 updated value";
Label2.Text = "Label2 updated value";
ScriptManager1.RegisterDataItem(Label3, "Label3 updated value");
}
C.protected void btnSubmit_Click(object sender, EventArgs e) {
ScriptManager1.RegisterDataItem(Label1, "Label1 updated value");
ScriptManager1.RegisterDataItem(Label2, "Label2 updated value");
Label3.Text = "Label3 updated value";
}
D.protected void btnSubmit_Click(object sender, EventArgs e) {
Label1.Text = "Label1 updated value";
Label2.Text = "Label2 updated value";
ScriptManager1.RegisterAsyncPostBackControl(Label3); Label3.Text = "Label3 updated value";
}
Answer: B
QUESTION 25
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Web form in the application by using the following code fragment. (Line numbers are included for reference only.)
01
07
08 10 11 13
14
15
17
18
19
You plan to create a client-side script code by using ASP.NET AJAX. You need to ensure that while a request is being processed, any subsequent Click events on the btnSubmit Button control are suppressed. Which code fragment should you insert at line 10? A. B. C. D.
Answer: C
Answer: C
QUESTION 22 You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application has an ASPX page named ErrorPage.aspx. You plan to manage the unhandled application exceptions. You need to perform the following tasks: Display the ErrorPage.aspx page Write the exceptioninformation in the Event log file. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.) A.Add the following code fragment to the Web.config file.
Answer: C QUESTION 24 You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You write the following code fragment.
08 10 11 13
You plan to create a client-side script code by using ASP.NET AJAX. You need to ensure that while a request is being processed, any subsequent Click events on the btnSubmit Button control are suppressed. Which code fragment should you insert at line 10? A. B. C. D.
Answer: C