70-562

TS: MS .NET Framework 3.5, ASP.NET Application Development


Note: The answer is for reference only, you need to understand all question.
QUESTION 1
You create a Microsoft ASP.NET application by using the Microsoft .NET
Framework version 3.5.
You add a TextBox control named TextBox1.
You write the following code segment for validation.
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args) { DateTime dt = String.IsNullOrEmpty(args.Value) ? DateTime.Now : Convert.ToDateTime(args.Value); args.IsValid = (DateTime.Now -dt).Days < 10;
}
You need to validate the value of TextBox1.
Which code fragment should you add to the Web page?
A.
B.
C.
D.



Answer: B
QUESTION 2
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You write the following code fragment. (Line numbers are included for reference only.)
01 06 07 08 09
You need to ensure that the error message displayed in the validation control is also displayed in the validation summary list.
What should you do?
A. Add the following code segment to line 06. Required text in TextBox1
B. Add the following code segment to line 04. Text="Required text in TextBox1"
C. Add the following code segment to line 04. ErrorMessage="Required text in TextBox1"
D. Add the following code segment to line 04. Text="Required text in TextBox1" ErrorMessage="ValidationSummary1"
Answer: C
QUESTION 3
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You write the following code fragment.

onselectedindexchanged="DropDownList1_SelectedIndexChanged"> 1 2 3

You also add a MultiView control named MultiView1 to the Web page. MultiView1 has three child View controls.
You need to ensure that you can select the View controls by using the DropDownList1 DropDownList control.
Which code segment should you use?
A. int idx = DropDownList1.SelectedIndex; MultiView1.ActiveViewIndex = idx;
B. int idx = DropDownList1.SelectedIndex; MultiView1.Views[idx].Visible = true;
C. int idx = int.Parse(DropDownList1.SelectedValue); MultiView1.ActiveViewIndex = idx;
D. int idx = int.Parse(DropDownList1.SelectedValue); MultiView1.Views[idx].Visible = true;

Answer: A
QUESTION 4
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"); } 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();
}
Answer: D QUESTION 5


You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application has a Web form file named MovieReviews.aspx.
The MovieReviews.aspx file connects to a LinqDataSource DataSource named LinqDataSource1 that has a primary key named MovieID.
The application has a DetailsView control named DetailsView1.
The MovieReviews.aspx file contains the following code fragment. (Line numbers are included for reference only.)
01 04 05 06 07 08 09 10
You need to ensure that the users can insert and update content in the DetailsView1 control.
You also need to prevent duplication of the link button controls for the Edit and New operations.
Which code segment should you insert at line 02?
A. AllowPaging="false" AutoGenerateRows="false"
B. AllowPaging="true" AutoGenerateRows="false" DataKeyNames="MovieID"
C. AllowPaging="true" AutoGenerateDeleteButton="false" AutoGenerateEditButton="true" AutoGenerateInsertButton="true" AutoGenerateRows="false"
D. AllowPaging="false" AutoGenerateDeleteButton="false"

AutoGenerateEditButton="true" AutoGenerateInsertButton="true" AutoGenerateRows="false" DataKeyNames="MovieID"

Answer: B
QUESTION 6
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You add an XmlDataSource control named XmlDataSource1 to the Web page. XmlDataSource1 is bound to an XML document with the following structure.

...

You also write the following code segment in the code-behind file of the Web page.
protected void BulletedList1_Click(object sender, BulletedListEventArgs e) { //... }
You need to add a BulletedList control named BulletedList1 to the Web page that is bound to XmlDataSource1.
Which code fragment should you use?
A.
B.
C.

D.

Answer: C
QUESTION 7
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create the following controls:

A composite custom control named MyControl. A templated custom control named OrderFormData. You write the following code segment to override the method named CreateChildControls() in the MyControl class. (Line numbers are included for reference only.)
01 protected override void CreateChildControls() { 02 Controls.Clear(); 03 OrderFormData oFData = new OrderFormData("OrderForm"); 04 05 }
You need to add the OrderFormData control to the MyControl control.
Which code segment should you insert at line 04?
A. Controls.Add(oFData);
B. Template.InstantiateIn(this); Template.InstantiateIn(oFData);
C. Controls.Add(oFData); this.Controls.Add(oFData);
D. this.TemplateControl = (TemplateControl)Template; oFData.TemplateControl = (TemplateControl)Template; Controls.Add(oFData);
Answer: B
QUESTION 8

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 04 08 09 10 11 12
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
QUESTION 9
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a Web page named Default.aspx in the root of the application. You add an ImageResources.resx resource file in the App_GlobalResources folder. The ImageResources.resx file contains a localized resource named LogoImageUrl. You need to retrieve the value of LogoImageUrl.

Which code segment should you use?
A.string logoImageUrl = (string)GetLocalResourceObject("LogoImageUrl"); B.string logoImageUrl = (string)GetGlobalResourceObject("Default", "LogoImageUrl"); C.string logoImageUrl = (string)GetGlobalResourceObject("ImageResources", "LogoImageUrl"); D.string logoImageUrl = (string)GetLocalResourceObject("ImageResources.LogoImageUrl");

Answer: C
QUESTION 10
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a Web page named enterName.aspx. The Web page contains a TextBox control named txtName. The Web page cross posts to a page named displayName.aspx that contains a Label control named lblName. You need to ensure that the lblName Label control displays the text that was entered in the txtName TextBox control. Which code segment should you use?
A. lblName.Text = Request.QueryString["txtName"];
B. TextBox txtName = FindControl("txtName") as TextBox; lblName.Text = txtName.Text;
C. TextBox txtName = Parent.FindControl("txtName") as TextBox; lblName.Text = txtName.Text;
D. TextBox txtName = PreviousPage.FindControl("txtName") as TextBox; lblName.Text = txtName.Text;
Answer: D

QUESTION 11
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 class named MultimediaDownloader that implements the IHttpHandler interface.
namespace Contoso.Web.UI { public class MultimediaDownloader : IHttpHandler { ... } }
The MultimediaDownloader class performs the following tasks:


It returns the content of the multimedia files from the Web server

It processes requests for the files that have the .media file extension
The .media file extension is mapped to the aspnet_isapi.dll file in Microsoft IIS 6.0.
You need to configure the MultimediaDownloader class in the Web.config file of the application.
Which code fragment should you use?
A. B. C. D.

Answer: C
QUESTION 12
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application must redirect the original URL to a different ASPX page. You need to ensure that the users cannot view the original URL after the page is executed. You also need to ensure that each page execution requires only one request from the client browser. What should you do?
A.Use the Server.Transfer method to transfer execution to the correct ASPX page. B.Use the Response.Redirect method to transfer execution to the correct ASPX page. C.Use the HttpContext.Current.RewritePath method to transfer execution to the correct ASPX page. D.Add the Location: new URL value to the Response.Headers collection. Call the Response.End() statement.
Send the header to the client computer to transfer execution to the correct ASPX page.
Answer: C
QUESTION 13
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.

The Web site uses C# as the programming language. You plan to add a code file written in Microsoft VB.NET to the application. This code segment will not be converted to C#.
You add the following code fragment to the Web.config file of the application.

You need to ensure that the following requirements are met:

The existing VB.NET file can be used in the Web application The file can be modified and compiled at run time What should you do?
A.Create a new class library that uses VB.NET as the programming language. Add the VB.NET code file to the class library. Add a reference to the class library in the application. B.Create a new folder named VBCode at the root of the application. Place the VB.NET code file in this new folder.
C.Create a new Microsoft Windows Communication Foundation (WCF) service project that uses VB.NET as the programming language. Expose the VB.NET code functionality through the WCF service. Add a service reference to the WCF service project in the application.
D.Create a new folder named VBCode inside the App_Code folder of the application. Place the VB.NET code file in this new folder.
Answer: D
QUESTION 14
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 { base.OnInit(e);

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 15
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application runs on Microsoft IIS 6.0.
You create a page named oldPage.aspx.
You need to ensure that the following requirements are met when a user attempts to access the page:

The browser diplays the URL of the oldPage.aspx page.
The browser displays the page named newPage.aspx
Which code segment should you use?
A. Server.Transfer("newPage.aspx");
B. Response.Redirect("newPage.aspx");
C. if (Request.Url.UserEscaped) {
Server.TransferRequest("newPage.aspx"); } else {
Response.Redirect("newPage.aspx", true); }
D. if (Request.Url.UserEscaped) { Response.RedirectLocation = "oldPage.aspx";

Response.Redirect("newPage.aspx", true); } else {
Response.Redirect("newPage.aspx"); }

Answer: A
QUESTION 16
You modify an existing Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You add a theme to the ASP.NET application.
You need to apply the theme to override any settings of individual controls.
What should you do?
A.In the Web.config file of the application, set the Theme attribute of the pages element to the name of the theme. B.In the Web.config file of the application, set the StyleSheetTheme attribute of the pages element to the name of the theme. C.Add a master page to the application. In the @Master directive, set the Theme attribute to the name of the theme. D.Add a master page to the application. In the @Master directive, set the StyleSheetTheme attribute to the name of the theme.

Answer: A
QUESTION 17
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application has a mobile Web form that contains the following ObjectList control.


You create an event handler named ObjectListCtrl_ItemCommand.
You need to ensure that the ObjectListCtrl_ItemCommand handler detects the selection of the CmdDisplayDetails item.

Which code segment should you write?
A. public void ObjectListCtrl_ItemCommand(object sender, ObjectListCommandEventArgs e) { if (e.CommandName == "CmdDisplayDetails") { }
}
B. public void ObjectListCtrl_ItemCommand(object sender, ObjectListCommandEventArgs e) { if (e.CommandArgument.ToString() == "CmdDisplayDetails") { }
}
C. public void ObjectListCtrl_ItemCommand(object sender, ObjectListCommandEventArgs e) { ObjectListCommand cmd = sender as ObjectListCommand; if (cmd.Name == "CmdDisplayDetails") { }
}
D. public void ObjectListCtrl_ItemCommand(object sender, ObjectListCommandEventArgs e) { ObjectListCommand cmd = e.CommandSource as ObjectListCommand; if (cmd.Name == "CmdDisplayDetails") { }
}
Answer: A
QUESTION 18
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
The application contains the following device filter element in the Web.config file.

The application contains a Web page that has the following image control. (Line numbers are included for reference only.)
01 03
You need to ensure that the following conditions are met:

The imgCtrl Image control displays he highRes.jpg file if the Web browser supports html.
The imgCtrl Image control displays lowRes.gif if the Web browser does not support html

Which DeviceSpecific element should you insert at line 02?
A.

B.

C.

D.


Answer: A
QUESTION 19
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
When you review the application performance counters, you discover that there is an unexpected increase in the value of the Application Restarts counter.
You need to identify the reasons for this increase.
What are three possible reasons that could cause this increase? (Each correct answer presents a complete solution. Choose three.)
A. Restart of the Microsoft IIS 6.0 host.
B. Restart of the Microsoft Windows Server 2003 that hosts the Web application.
C. Addition of a new assembly in the Bin directory of the application.
D. Addition of a code segment that requires recompilation to the ASP.NET Web application.
E. Enabling of HTTP compression in the Microsoft IIS 6.0 manager for the application.
F. Modification to the Web.config file in the system.web section for debugging the application.
Answer: CDF QUESTION 20

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You add the following code fragment to the Web.config file of the application (Line numbers are includedfor reference only).
01 02 03 11 12 13
You need to configure Web Events to meet the following requirements:
Security-related Web Events are mapped to Microsoft Windows Management Instrumentation (WMI) events.
Web Events caused by problems with configuration or application code are logged into the Windows Application Event Log.
Which code fragment should you insert at line 07?
A.
B.
C.
D.
Answer: B QUESTION 21

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
When you access the application in a Web browser, you receive the following error message: "Service Unavailable".
You need to access the application successfully.
What should you do?
A. Start Microsoft IIS 6.0.
B. Start the Application pool.
C. Set the .NET Framework version.
D. Add the Web.config file for the application.

Answer: B
QUESTION 22
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 23
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You plan to capture the timing and performance information of the application.
You need to ensure that the information is accessible only when the user is logged on to the Web server and not on individual Web pages.
What should you add to the Web.config file?
A.
B.
C.
D.
Answer: C
QUESTION 24
You create a Microsoft ASP.NET AJAX application by using the Microsoft .NET Framework version 3.5.
A JavaScript code segment in the AJAX application does not exhibit the desired behavior. Microsoft Internet Explorer displays an error icon in the status bar but does not prompt you to debug the script.
You need to configure the Internet Explorer to prompt you to debug the script.

Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Clear the Disable Script Debugging (Other) check box.
B. Clear the Disable Script Debugging (Internet Explorer) check box.
C. Select the Show friendly HTTP error messages check box.
D. Select the Enable third-party browser extensions check box.
E. Select the Display a notification about every script error check box.

Answer: BE
QUESTION 25
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You host the application on a server named ContosoTest that runs Microsoft IIS 6.0. You set up remote debugging on the ContosoTest server.
You need to debug the application remotely from another computer named ContosoDev.
What should you do?
A. Attach Microsoft Visual Studio.NET to the w3wp.exe process.
B. Attach Microsoft Visual Studio.NET to the inetinfo.exe process.
C. Attach Microsoft Visual Studio.NET to the Msvsmon.exe process.
D. Attach Microsoft Visual Studio.NET to the WebDev.WebServer.exe process.

Answer: A
QUESTION 26
You have a Microsoft ASP.NET Framework version 1.0 application. The application does not use any features that are deprecated in the Microsoft .NET Framework version 3.5. The application runs on Microsoft IIS 6.0.
You need to configure the application to use the ASP.NET Framework version 3.5 without recompiling the application.
What should you do?
A.Edit the ASP.NET runtime version in IIS 6.0. B.Edit the System.Web section handler version number in the machine.config file. C.Add the requiredRuntime configuration element to the Web.config file and set the version attribute to v3.5.

D.Add the supportedRuntime configuration element in the Web.config file and set the version attribute to v3.5.

Answer: A
QUESTION 27
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
You deploy the application on a Microsoft IIS 6.0 Web server. The server runs on a worker process isolation mode, and it hosts the .NET Framework version 1.1 Web applications.
When you attempt to browse the application, the following error message is received:
"It is not possible to run different versions of ASP.NET in the same IIS process. Please use the IIS Administration Tool to reconfigure your server to run the application in a separate process."
You need to ensure that the following requirements are met:

All the applications run on the server All the applications remain in process isolation mode All the applications do not change their configuration. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A.Create a new application pool and add the new application to the pool. B.Configure the IIS 6.0 to run the WWW service in the IIS 5.0 isolation mode. C.Configure the new application to use the .NET Framework version 2.0 in the IIS 6.0 Manager. D.Set autoConfig="false" on the property in the machine.config file. E.Disable the Recycle worker processes option in the Application Pool Properties dialog box.

Answer: AC
QUESTION 28
You are maintaining a Microsoft ASP.NET Web Application that was created by using the Microsoft .NET Framework version 3.5.
You obtain the latest version of the project from the source control repository. You discover that an assembly reference is missing when you attempt to compile the project on your computer.
You need to compile the project on your computer.
What should you do?

A.Add a reference path in the property pages of the project to the location of the missing assembly. B.Add a working directory in the property pages of the project to the location of the missing assembly. C.Change the output path in the property pages of the project to the location of the missing assembly. D.Delete the assembly reference. Add a reference to the missing assembly by browsing for it on your
computer.

Answer: A
QUESTION 29
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
You use Windows Authentication for the application. You set up NTFS file system permissions for the Sales group to access a particular file. You discover that all the users are able to access the file.
You need to ensure that only the Sales group users can access the file.
What additional step should you perform?
A. Remove the rights from the ASP.NET user to the file.
B. Remove the rights from the application pool identity to the file.
C. Add the section to the Web.config file.
D. Add the section to the Web.config file.

Answer: C
QUESTION 30
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a login Web form by using the following code fragment.

When a user clicks the btnLogin Button control, the login() client-side script is called to authenticate the user. The credentials provided in the TextBox controls are used to call the client-side script.
You also add the following client-script code fragment in the Web form. (Line numbers are included for reference only.)

01
The ASP.NET application is configured to use Forms Authentication. The ASP.NET AJAX authentication service is activated in the Web.config file.
You need to ensure that the following workflow is maintained:

On successful authentication, the onLoginCompleted clien-script function is called to notify the user.
On failure of authentication, the onLoginFailed clien-script function is called to display an error message.
Which code segment should you insert at line 06?
A.var auth = Sys.Services.AuthenticationService; auth.login(username, password, false, null, null,onLoginCompleted, onLoginFailed, null);
B.var auth = Sys.Services.AuthenticationService; auth.set_defaultFailedCallback(onLoginFailed); var validCredentials = auth.login(username, password, false, null, null, null, null, null); if (validCredentials) onLoginCompleted(true, null, null); else onLoginCompleted(false, null, null);
C.var auth = Sys.Services.AuthenticationService; auth.set_defaultLoginCompletedCallback(onLoginCompleted); try { auth.login(username, password, false, null, null, null, null, null); } catch (err) {

onLoginFailed(err, null, null); } D.var auth = Sys.Services.AuthenticationService;
try { var validCredentials = auth.login(username, password, false, null, null, null, null, null); if (validCredentials)
onLoginCompleted(true, null, null); else
onLoginCompleted(false, null, null); } catch (err) {
onLoginFailed(err, null, null); }

Answer: A
QUESTION 31
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create an AJAX-enabled Web form by using the following code fragment.



...

When the updFirstPanel UpdatePanel control is updated, a dynamic client script is registered.
You write the following code segment in the code-behind file of the Web form. (Line numbers are included for reference only.)
01 protected void Page_Load(object sender, EventArgs e) 02 { 03 if(IsPostBack) 04 {

string generatedScript = ScriptGenerator.GenerateScript();
07 } 08 }
You need to ensure that the client-script code is registered only when an asynchronous postback is issued on the updFirstPanel UpdatePanel control.
Which code segment should you insert at line 06?
A.ClientScript.RegisterClientScriptBlock(typeof(TextBox), "txtInfo_Script", generatedScript); B.ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "txtInfo_Script", generatedScript, false); C.ClientScript.RegisterClientScriptBlock(typeof(Page), "txtInfo_Script", generatedScript); D.ScriptManager.RegisterClientScriptBlock(txtInfo, typeof(TextBox), "txtInfo_Script", generatedScript, false);

Answer: D
QUESTION 32
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version3.5.
You add the following code fragment to an AJAX-enabled Web form. (Line numbers are included for reference only.)
01 02 04 05 06 08 09 12 13 14 15 16 17
The tmrTimer_Tick event handler sets the Text property of the lblTime Label control to the current time of the server.
You need to configure the appropriate UpdatePanel control to ensure that the lblTime Label Control is properly

updated by the tmrTimer Timer control.
What should you do?
A. Set the UpdateMode="Always" attribute to the updInnerPanel UpdatePanel control in line 07.
B. Set the ChildrenAsTriggers="false" attribute to the updPanel UpdatePanel control in line 02.
C. Add the following code fragment to line 13.

D. Add the following code fragment to line 16.


Answer: D
QUESTION 33
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Web form by using ASP.NET AJAX.
The Web form contains the following code fragment. (Line numbers are included for reference only.)
01 11 12
You need to create and initialize a client behavior named MyCustomBehavior by using the
initComponents function. You also need to ensure that MyCustomBehavior is attached to the TextBox1 Textbox control.
Which code segment should you insert at line 06?
A. $create(MyCustomBehavior, null, null, null, 'TextBox1');
B. $create(MyCustomBehavior, null, null, null, $get('TextBox1'));
C. Sys.Component.create(MyCustomBehavior, 'TextBox1', null, null, null);

D. Sys.Component.create(MyCustomBehavior, $get('TextBox1'), null, null, null);

Answer: B
QUESTION 34
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 35
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a Web form by using ASP.NET AJAX. You write the following client-script code fragment to handle the exceptions thrown from asynchronous
postbacks. (Line numbers are included for reference only.) 01
You need to ensure that the application performs the following tasks: Use a common clien-script function named errorHandler. Update a Label control that has an ID named lblEror with the error message. Prevent the browser from displaying any message box or Javascript error
What should you do?
A. Insert the following code segment at line 06. pageMgr.add_endRequest(errorHandler);
Insert the following code segment at line 11.
if (args.get_error() != null) { $get('lblError').innerHTML = args.get_error().message; args.set_errorHandled(true);
}
B. Insert the following code segment at line 06. pageMgr.add_endRequest(errorHandler);

Insert the following code segment at line 11. if (args.get_error() != null) { $get('lblError').innerHTML = args.get_error().message; }
C. Insert the following code segment at line 06. pageMgr.add_pageLoaded(errorHandler);
Insert the following code segment at line 11.
if (args.get_error() != null) { $get('lblError').innerHTML = args.get_error().message; args.set_errorHandled(true);
}
D. Insert the following code segment at line 06. pageMgr.add_pageLoaded(errorHandler);
Insert the following code segment at line 11. if (args.get_error() != null) { $get('lblError').innerHTML = args.get_error().message; }

Answer: A
QUESTION 36
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application consumes a Microsoft Windows Communication Foundation (WCF) service.
The WCF service exposes the following method.
[WebInvoke] string UpdateCustomerDetails(string custID);
The application hosts the WCF service by using the following code segment.
WebServiceHost host = new WebServiceHost(typeof(CService), new Uri("http://win/")); ServiceEndpoint ep = host.AddServiceEndpoint(typeof(ICService), new WebHttpBinding(), "");
You need to invoke the UpdateCustomerDetails method.
Which code segment should you use?
A.WebChannelFactory wcf = new WebChannelFactory(new Uri("http://win")); ICService channel = wcf.CreateChannel();

string s = channel.UpdateCustomerDetails("CustID12"); B.WebChannelFactory wcf = new WebChannelFactory(new Uri("http://win/UpdateCustomerDetails")); ICService channel = wcf.CreateChannel(); string s = channel.UpdateCustomerDetails("CustID12"); C.ChannelFactory cf = new ChannelFactory(new WebHttpBinding(), "http://win/UpdateCustomerDetails"); ICService channel = cf.CreateChannel(); string s = channel.UpdateCustomerDetails("CustID12"); D.ChannelFactory cf = new ChannelFactory(new BasicHttpBinding(), "http://win "); cf.Endpoint.Behaviors.Add(new WebHttpBehavior()); ICService channel = cf.CreateChannel(); string s = channel.UpdateCustomerDetails("CustID12");

Answer: A
QUESTION 37
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You add a Web form that contains the following code fragment.

You write the following code segment for the GetData method of the DAL class. (Line numbers are included for reference only.)
01 public object GetData() { 02 SqlConnection cnn = new SqlConnection(); 03 string strQuery = "SELECT * FROM Products"; 05 }
You need to ensure that the user can use the sorting functionality of the gvProducts GridView control.
Which code segment should you insert at line 04?
A. SqlCommand cmd = new SqlCommand(strQuery, cnn); cnn.Open(); return cmd.ExecuteReader();
B. SqlCommand cmd = new SqlCommand(strQuery, cnn);

cnn.Open(); return cmd.ExecuteReader(CommandBehavior.KeyInfo);
C. SqlDataAdapter da = new SqlDataAdapter(strQuery, cnn); DataSet ds = new DataSet(); da.Fill(ds); return ds;
D. SqlDataAdapter da = new SqlDataAdapter(strQuery, cnn); DataSet ds = new DataSet(); da.Fill(ds); ds.ExtendedProperties.Add("Sortable", true); return ds.Tables[0].Select();

Answer: C
QUESTION 38
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Web page to display photos and captions. The caption of each photo in the database can be modified by using the application.
You write the following code fragment.





When you access the Web page, the application throws an error.
You need to ensure that the application successfully updates each caption and stores it in the database.
What should you do?
A. Add the ID attribute to the Label control.
B. Add the ID attribute to the TextBox control.

C. Use the Bind function for the Label control instead of the Eval function.
D. Use the Eval function for the TextBox control instead of the Bind function.

Answer: B
QUESTION 39
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application consumes an ASMX Web service. The Web service is hosted at the following URL.
http://www.contoso.com/TemperatureService/Convert.asmx
You need to ensure that the client computers can communicate with the service as part of the configuration.
Which code fragment should you use?
A.
B. C. D.
Answer: B
QUESTION 40
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You define the following class.
public class Product {

public decimal Price { get; set; } }
Your application contains a Web form with a Label control named lblPrice.
You use a StringReader variable named xmlStream to access the following XML fragment.
35
You need to display the price of the product from the XML fragment in the lblPrice Label control.
Which code segment should you use?
A. DataTable dt = new DataTable(); dt.ExtendedProperties.Add("Type", "Product"); dt.ReadXml(xmlStream); lblPrice.Text = dt.Rows[0]["Price"].ToString();
B. XmlReader xr = XmlReader.Create(xmlStream); Product boughtProduct = xr.ReadContentAs(typeof(Product), null) as Product; lblPrice.Text = boughtProduct.Price.ToString();
C. XmlSerializer xs = new XmlSerializer(typeof(Product)); Product boughtProduct = xs.Deserialize(xmlStream) as Product; lblPrice.Text = boughtProduct.Price.ToString();
D. XmlDocument xDoc = new XmlDocument(); xDoc.Load(xmlStream); Product boughtProduct = xDoc.OfType().First(); lblPrice.Text = boughtProduct.Price.ToString();
Answer: C
QUESTION 41
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
You create an ASMX Web service in the application by using the following code segment. (Line numbers are included for reference only.)
01 [WebService(Namespace = "http://adatum.com/")] 02 [ScriptService] 03 public class PaymentService : WebService 04 {

06 [WebMethod] 08 public XmlDocument GetPaymentInformation() 09 { 10 XmlDocument payment = Payment.GetPaymentInfo(); 11 return payment; 12 } 13 }
You plan to invoke the PaymentService object from the client-script object by using ASP.NET AJAX. You need to ensure that the client-script object that is retrieved from the Web service represents a valid XmlDocument object.
Which code segment should you insert at line 07?
A. [ScriptMethod]
B. [ScriptMethod(XmlSerializeString=true)]
C. [ScriptMethod(UseHttpGet=true)]
D. [ScriptMethod(ResponseFormat=ResponseFormat.Xml)]

Answer: D
QUESTION 42
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 exception information 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 43
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. All the content pages in the application use a single master page. The master page uses a static navigation menu to browse the site.
You need to ensure that the content pages can optionally replace the static navigation menu with their own menu controls.
What should you do?
A.Add the following code fragment to the master page.
< asp:PlaceHolder ID="MenuPlaceHolder " runat="server" > < div id="menu" > < !--Menu code here --> < /div >
< /asp:PlaceHolder >
Add the following code segment to the Page_Load event of the content page. PlaceHolder placeHolder = Page.Master.FindControl("MenuPlaceHolder") as PlaceHolder; Menu menuControl = new Menu(); placeHolder.Controls.Add(menuControl);
B.Add the following code fragment to the master page. < asp:ContentPlaceHolder ID="MenuPlaceHolder " runat="server" >
Add the following code fragment to the content page.
< asp:Content PlaceHolderID="MenuPlaceHolder" > < asp:menu ID="menuControl" runat="server" >

C.Add the following code fragment to the master page. < asp:ContentPlaceHolder ID="MenuPlaceHolder " runat="server" > < !--Menu code here --> < /asp:ContentPlaceHolder >
Add the following code segment to the Page_Load event of the content page ContentPlaceHolder placeHolder = Page.Master.FindControl("MenuPlaceHolder") as ContentPlaceHolder; Menu menuControl = new Menu(); placeHolder.Controls.Add(menuControl);
D.Add the following code fragment to the master page
Add the following code fragment to the content page



Answer: B
QUESTION 44
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
You create an ASMX Web service in the application by using the following code segment.
[WebService(Namespace = "http://geo.service.org/")] public class GeographyService : System.Web.Services.WebService {
public GeographyService () { }
[WebMethod]
public string GetCapitalCity(string szCountryName) { string city = string.Empty; //query db to get city name //... return city;
} }
You need to ensure that the ASMX Web service can be accessed from the client script by using ASP.NET

AJAX.
Which three actions should you perform? (Each correct answer presents part of the solution. Choose three.)
A.Add a ScriptReference element to the ScriptManager element in the following manner. B.Decorate the GeographyService class by using the [System.Web.Script.Services.ScriptService] attribute. C.Add a ServiceReference element to the ScriptManager element in the following manner. D.Add the following XML fragment to the Web.config file of the Web application.

E.Add the following XML fragment to the Web.config file of the Web application.

F.Decorate the GetCapitalCity method by using the [System.Web.Script.Services.ScriptMethod] attribute.
Answer: BCE
QUESTION 45
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
To add a Calendar server control to a Web page, you write the following code fragment.



You need to disable the non-week days in the Calendar control.
What should you do?
A.Add the following code segment to the Calendar1 DayRender event handler. if (e.Day.IsWeekend) { Day.IsSelectable = false; } B.Add the following code segment to the Calendar1 DayRender event handler. if (e.Day.IsWeekend) { if (Calendar1.SelectedDates.Contains(e.Day.Date)) Calendar1.SelectedDates.Remove(e.Day.Date); }
C.Add the following code segment to the Calendar1 SelectionChanged event handler. List list = new List(); foreach (DateTime st in (sender as Calendar).SelectedDates) {
if (st.DayOfWeek == DayOfWeek.Saturday || st.DayOfWeek == DayOfWeek.Sunday) { list.Add(st);
} } foreach (DateTime dt in list) {
(sender as Calendar).SelectedDates.Remove(dt); }
D.Add the following code segment to the Calendar1 DataBinding event handler. List list = new List(); foreach (DateTime st in (sender as Calendar).SelectedDates) {
if (st.DayOfWeek == DayOfWeek.Saturday || st.DayOfWeek == DayOfWeek.Sunday) { list.Add(st);
} } foreach (DateTime dt in list) {
(sender as Calendar).SelectedDates.Remove(dt); }
Answer: A
QUESTION 46
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.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
...


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
QUESTION 47
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a file named movies.xml that contains the following code fragment.





You add a Web form to the application.
You write the following code segment in the Web form. (Line numbers are included for reference only.)
01
02 03 04
You need to implement the XmlDataSource control to display the XML data in a TreeView control.
Which code segment should you insert at line 03?
A.

B.

C.

D.



Answer: A
QUESTION 48
You create a Microsoft ASP.NET Web application named WebApp1 by using the Microsoft .NET Framework version 3.5.
The application uses client-side scripts and server-side controls.
You plan to deploy the application to a Web server that runs the ASP.NET Framework version 1.1. You need to ensure that the Web server is properly configured for the new application. You also need to ensure that the existing applications remain unaffected.
What should you do?
A. Execute the aspnet_regiis -s W3SVC/1/Root/WebApp1 command.
B. Execute the aspnet_regiis -ir command.
C. Execute the aspnet_regiis -i command.
D. Execute the aspnet_regiis -sn W3SVC/1/Root/WebApp1 command.

Answer: B
QUESTION 49
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application uses Session objects. You are modifying the application to run on a Web farm.
You need to ensure that the application can access the Session objects from all the servers in the Web farm. You also need to ensure that when any server in the Web farm restarts or stops responding, the Session objects are not lost.
What should you do?
A.Use the InProc Session Management mode to store session data in the ASP.NET worker process. B.Use the SQLServer Session Management mode to store session data in a common Microsoft SQL Server 2005 database. C.Use the SQLServer Session Management mode to store session data in an individual database for each Web server in the Web farm. D.Use the StateServer Session Management mode to store session data in a common State Server process on a Web server in the Web farm.


Answer: B
QUESTION 50
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. To create a JavaScript class named Employee, you write the following code segment. (Line numbers are included for reference only.)
01 Type.registerNamespace("HR"); 02 HR.Employee = function(firstName, lastName) { 03 this._firstName = firstName; 04 this._lastName = lastName; 05 } 07 HR.Employee.prototype.get_FirstName = function() { 08 return this._firstName; 09 } 11 HR.Employee.prototype.set_FirstName = function(first) { 12 this._firstName = first; 13 } 15 HR.Employee.prototype.get_LastName = function() { 16 return this._lastName; 17 } 19 HR.Employee.prototype.set_LastName = function(last) { 20 this._lastName = last; 21 } 23 HR.Employee.prototype.dispose = function() { 24 }
You need to register the Employee class with the ASP.NET AJAX Framework to meet the following requirements:

The Employee class derives from a class named Person.
The Employee class implements the Sys.IDisposable JavaScript interface.
Which code segment should you add at line 25?
A. HR.Employee.registerInterface("Sys.IDisposable"); HR.Employee.registerClass("HR.Employee", Person);
B. HR.Employee.registerClass("HR.Employee", Person, Sys.IDisposable);
C. HR.Employee.registerInterface("Sys.IDisposable"); HR.Employee.registerClass("Employee", Person);
D. HR.Employee.registerClass("Employee", Person, Sys.IDisposable);


Answer: B
QUESTION 51
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 the value of txt2 is greater than the value of txt1 before the page is submitted to the server.
Which code fragment should you use?
A.ControlToValidate="txt2"
ErrorMessage="txt2 not bigger than txt1" Text="*"
ControlToCompare="txt1" MinimumValue="0" MaximumValue="txt2" Type="Integer" Runat="Server" />
B.ControlToValidate="txt2"
ErrorMessage="txt2 not bigger than txt1" Text="*"
ControlToCompare="txt1"
Operator="GreaterThanEqual"
Type="Integer" Runat="Server" />
C.ControlToValidate="txt1"
ErrorMessage="txt2 not bigger than txt1" Text="*"
ControlToCompare="txt2" MinimumValue="0" MaximumValue="txt2" Type="Integer" Runat="Server" />
D.ControlToValidate="txt2"
ErrorMessage="txt2 not bigger than txt1" Text="*"
ControlToCompare="txt1"
Operator="GreaterThan"
Type="Integer" Runat="Server" />

Answer: D
QUESTION 52
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application consumes a Microsoft Windows Communication Foundation (WCF) service.

The WCF service exposes the following method.
[WebGet] string GetCustomerDetails(string custID);
The application hosts the WCF service by using the following code segment.
WebServiceHost host = new WebServiceHost(typeof(CService), new Uri("http://win/")); ServiceEndpoint ep = host.AddServiceEndpoint(typeof(ICService), new WebHttpBinding(), "");
You need to invoke the GetCustomerDetails method.
Which code segment should you use?
A.HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://win/GetCustomerDetails?custid=123"); B.HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://win/GetCustomerDetails/custid=123"); C.HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://win/GetCustomerDetails/custid/123"); D.HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://win/GetCustomerDetails=123");

Answer: A
QUESTION 53
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Web page that uses 20 transparent image controls.
The image controls align the content of the Web page.
You need to ensure that the HTML code generated for the Web page instructs the non-visual browsers to ignore the transparent images.
What should you do?
A. Set the GenerateEmptyAlternateText="true" property on each image.
B. Set the AlternateText="(blank)" property on each image.
C. Set the AlternateText="" property on each image.
D. Set the GenerateEmptyAlternateText="false" property on each image.

Answer: A

QUESTION 54
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create an ASP.NET AJAX Web form in the application. You plan to configure the Web form to reference the following two validation script files:
Validation.js that displays messages in English
Validation.es-ES.js that displays localized messages in Spanish
You need to ensure that the configuration is performed on the basis of the UI Culture that is configured for the application.
Which code fragment should you use?
A. B. C.

D.
Answer: B
QUESTION 55

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create the SqlDataSource1 DataSource control to retrieve the details of authors. You write the following code fragment.
01 08
You create the DropDownList1 DropDownList control that contains a list of the author last names. You write the following code fragment.
Madrid Oslo Lisbon

You need to ensure that the SqlDataSource1 DataSource control retrieves the corresponding records for the author last name that is selected from the DropDownList1 DropDownList control.
What should you do?
A.Add the following code segment to line 05. FilterExpression="au_lname = ?"
Add the following code fragment to line 07.

B.Add the following code segment to line 05. FilterExpression="au_lname = ?
" Add the following code fragment to line 07. C.Add the following code segment to line 05. FilterExpression="au_lname = '{0}'"

Add the following code fragment to line 07. D.Add the following code segment to line 05. FilterExpression="au_lname = '{0}'"
Add the following code fragment to line 07.



Answer: D
QUESTION 56
You are developing a Web application for an online retailer.
The Web application contains order information. The order information must be exposed by using an RSS feed. You need to generate a private feed for the order information by using the least amount of code.
What should you do? (More than one answer choice may achieve the goal. Select the BEST answer.)
A.Create a SyndicationFeed object, format the object by using a formatter object, and write the object to the output stream by using a TextWriter instance. B.Create a StringBuilder object and write the object to the output stream by using a TextWriter instance. C.Create a StringBuilder object and write the object to the output stream by using an XmlWriter instance. D.Create a SyndicationFeed object, format the object by using a formatter object, and write the object to the output stream by using an XmlWriter instance.

Answer: D
QUESTION 57
You are developing a rich drop-down list Web control. The control items will include a left-aligned image and multiple rows of text to the right of the image. You need to ensure that the control property values are always available after a postback.
Where should the Web control store the property values? (More than one answer choice may achieve the goal. Select the BEST answer.)

A. in a Session variable
B. in Control state
C. in View state
D. in an Application variable

Answer: B
QUESTION 58
You create and deploy an online forum application that uses ASP.NET membership and roles. The application Web pages include Menu controls that display navigation links retrieved from a file named forum.sitemap.
Users who are not members of the Moderators role receive an "Access is Denied" message when they attempt to follow links to pages within a restricted folder named Moderators.
You need to ensure that the Menu controls display navigation links only to pages that the current user is authorized to access.
What should you do? (More than one answer choice may achieve the goal. Select the BEST answer.)
A.In the forum.sitemap file, add the roles="?" attribute to entries for Web pages in the Moderators folder. B.In the forum.sitemap file, remove entries for Web pages in the Moderators folder. C.In the Web.config file, apply the securityTrimmingEnabled="true" attribute to the default site-map provider. D.In the constructor for each Web page, add an event handler that handles the SiteMap.SiteMapResolve
event.

Answer: C
QUESTION 59
You are developing a Web page that allows users to search the contents of a Web site. The Web page must provide the following functionality:
Display up to 15 search results at a time. Display each search result in a custom layout that spans multiple lines.
Allow users to page through results if the search returns more than 15 matches.
Allow users to rate the quality of each search result directly within the search results.
You need to implement the required functionality.
What should you do? (More than one answer choice may achieve the goal. Select the BEST answer.)

A.Add a FormView control to the Web page and set its AllowPaging property to true. B.Add a GridView control to the Web page and set its AllowPaging property to true. C.Add a ListView control and a DataPager control to the Web page. Set the value of the PagedControlID
property of the DataPager control to the ID of the ListView control. D.Add a Repeater control to the Web page and assign an instance of the PagedDataSource class to its DataSource property.

Answer: C
QUESTION 60
You are developing a Web application. When a user logs on to the Web site, the application queries a Microsoft SQL Server database for recent activity associated with that user.
You need to store the query results so that pages in the site can access the original result set for up to 60 minutes.
What should you do? (More than one answer choice may achieve the goal. Select the BEST answer.)
A. Pass the query result from page to page by using a HiddenField control on each page.
B. Store the query result in an Application variable.
C. Store the query result in a Session variable.
D. Store the query result in a Cache object.

Answer: D
QUESTION 61
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
You plan to set up authentication for the Web application. The application must support users from untrusted domains.
You need to ensure that anonymous users cannot access the application.
Which code fragment should you add to the Web.config file?
A.



B.


C.

D.

Answer: A
QUESTION 62
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
The computer that hosts the ASP.NET Web application contains a local instance of Microsoft SQL Server 2005. The instance uses Windows Authentication. You plan to configure the membership providers and the role management providers.
You need to install the database elements for both the providers on the local computer.
What should you do?
A. Run the sqlcmd.exe -S localhost E command from the command line.
B. Run the aspnet_regiis.exe -s localhost command from the command line.
C. Run the sqlmetal.exe /server:localhost command from the command line.

D. Run the aspnet_regsql.exe -E -S localhost -A mr command from the command line.

Answer: D
QUESTION 63
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
The application uses ASP.NET AJAX, and you plan to deploy it in a Web farm environment.
You need to configure SessionState for the application.
Which code fragment should you use?
A.
B.
C.
D.

Answer: C
QUESTION 64
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You derive a new validation control from the BaseValidator class.
The validation logic for the control is implemented in the Validate method in the following manner.
protected bool Validate(string value) {
...
}
You need to override the method that validates the value of the related control.
Which override method should you use?
A. protected override bool EvaluateIsValid() { string value = GetControlValidationValue(this.Attributes["AssociatedControl"]); bool isValid = Validate(value); return isValid;

}
B. protected override bool ControlPropertiesValid() { string value = GetControlValidationValue(this.ValidationGroup); bool isValid = Validate(value); return isValid;
}
C. protected override bool EvaluateIsValid() { string value = GetControlValidationValue(this.ControlToValidate); bool isValid = Validate(value); return isValid;
}
D. protected override bool ControlPropertiesValid() { string value = GetControlValidationValue(this.Attributes["ControlToValidate"]); bool isValid = Validate(value); this.PropertiesValid = isValid; return true;
}

Answer: C
QUESTION 65
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You plan to submit text that contains HTML code to a page in the application.
You need to ensure that the HTML code can be submitted successfully without affecting other applications that run on the Web server.
What should you do?
A. Add the following attribute to the @Page directive. EnableEventValidation="true"
B. Add the following attribute to the @Page directive. ValidateRequest="true"
C. Set the following value in the Web.config file.

D. Set the following value in the Machine.config file.



Answer: C
QUESTION 66
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, RepeaterItemEventArgs e) 03 if (lbl != null) { 04 if (int.Parse(lbl.Text) < 10) { 05 lbl.ForeColor = Color.Red; 06 } 07 } 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 02?
A. Label lbl = (Label)Page.FindControl("lblQuantity");
B. Label lbl = (Label)e.Item.FindControl("lblQuantity");
C. Label lbl = (Label)rptData.FindControl("lblQuantity");
D. Label lbl = (Label)e.Item.Parent.FindControl("lblQuantity");
Answer: B
QUESTION 67
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.

You create a composite custom control named MyControl.
You need to add an instance of the OrderFormData control to the MyControl control.
Which code segment should you use?
A. protected override void CreateChildControls() { Controls.Clear(); OrderFormData oFData = new OrderFormData("OrderForm"); Controls.Add(oFData);
}
B. protected override void RenderContents(HtmlTextWriter writer) { OrderFormData oFData = new OrderFormData("OrderForm"); oFData.RenderControl(writer);
}
C. protected override void EnsureChildControls() { Controls.Clear(); OrderFormData oFData = new OrderFormData("OrderForm"); oFData.EnsureChildControls(); if (! ChildControlsCreated) {
CreateChildControls(); } }
D. protected override ControlCollection CreateControlCollection() { ControlCollection controls = new ControlCollection(this); OrderFormData oFData = new OrderFormData("OrderForm"); controls.Add(oFData); return controls;
}
Answer: A
QUESTION 68
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 Button1 control, a selected list of items move from the ListBox1 control to the ListBox2 control. Which code segment should you use?
A. foreach (ListItem li in ListBox1.Items) {
if (li.Selected) { ListBox2.Items.Add(li); ListBox1.Items.Remove(li);
} }
B. foreach (ListItem li in ListBox1.Items) {
if (li.Selected) { li.Selected = false; ListBox2.Items.Add(li);
} } foreach (ListItem li in ListBox2.Items) {
if (ListBox1.Items.Contains(li)) { ListBox1.Items.Remove(li); } }
C. foreach (ListItem li in ListBox1.Items) {
if (li.Selected) { li.Selected = false; ListBox2.Items.Add(li);
} } foreach (ListItem li in ListBox1.Items) {
if (ListBox2.Items.Contains(li)) { ListBox1.Items.Remove(li); } }
D. foreach (ListItem li in ListBox1.Items) {
if (li.Selected) { li.Selected = false; ListBox2.Items.Add(li); ListBox1.Items.Remove(li);
} }
Answer: B QUESTION 69

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application contains a DataSourceControl named CategoriesDataSource that is bound to a Microsoft SQL Server 2005 table. The CategoryName column is the primary key of the table.
You write the following code fragment in a FormView control. (Line numbers are included for reference only.)
01 02 Category: 03 04 10 11
You need to ensure that the changes made to the CategoryID field can be written to the database.
Which code fragment should you insert at line 05?
A. SelectedValue='<%# Eval("CategoryID") %>'
B. SelectedValue='<%# Bind("CategoryID") %>'
C. SelectedValue='<%# Eval("CategoryName") %>'
D. SelectedValue='<%# Bind("CategoryName") %>'
Answer: B
QUESTION 70
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 void 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 71
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a FormView control to access the results of a query. The query contains the following fields:

EmployeID
FirstName
LastName

The user must be able to view and update the FirstName field.
You need to define the control definition for the FirstName field in the FormView control.
Which code fragment should you use?
A." /> B." /> C. D.

Answer: C
QUESTION 72
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Web form that contains the following code fragment.

You write the following code segment in the code-behind file. (Line numbers are included for reference only.)
01 protected void Page_Load(object sender, EventArgs e) {
02 DataSet objDS = new DataSet();
03 SqlDataAdapter objDA = new SqlDataAdapter(objCmd);
04 objDA.Fill(objDS);
05 gridCities.DataSource = objDS;
06 gridCities.DataBind();
07 Session("ds") = objDS;
08 }

09 protected void btnSearch_Click(object sender, EventArgs e) 11 } You need to ensure that when the btnSearch Button control is clicked, the records in the gridCities GridView
control are filtered by using the value of the txtSearch TextBox. Which code segment you should insert at line 10?
A. DataSet ds = gridCities.DataSource as DataSet;

DataView dv = ds.Tables[0].DefaultView; dv.RowFilter = "CityName LIKE '" + txtSearch.Text + "%'"; gridCities.DataSource = dv; gridCities.DataBind();
B. DataSet ds = Session["ds"] as DataSet; DataView dv = ds.Tables[0].DefaultView; dv.RowFilter = "CityName LIKE '" + txtSearch.Text + "%'"; gridCities.DataSource = dv; gridCities.DataBind();
C. DataTable dt = Session["ds"] as DataTable; DataView dv = dt.DefaultView; dv.RowFilter = "CityName LIKE '" + txtSearch.Text + "%'"; gridCities.DataSource = dv; gridCities.DataBind();
D. DataSet ds = Session["ds"] as DataSet; DataTable dt = ds.Tables[0]; DataRow[] rows = dt.[Select]("CityName LIKE '" + txtSearch.Text + "%'"); gridCities.DataSource = rows; gridCities.DataBind();

Answer: B
QUESTION 73
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You write the following code fragment. (Line numbers are included for reference only.)
01 03 04 05 06 07 08 09 10 11 12
You need to ensure that the requirements shown in the following table are met.


What should you do?
A. Set the value of the ChildrenAsTriggers property in line 02 to false.
Add the following code fragment at line 04.
B. Set the value of the ChildrenAsTriggers property in line 02 to false.
Add the following code fragment at line 04.
C. Set the value of the ChildrenAsTriggers property in line 02 to true.
Add the following code fragment at line 04.
D. Set the value of the ChildrenAsTriggers property in line 02 to true.
Add the following code fragment at line 04.
Answer: D
QUESTION 74
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 08
09 10 11 12 13 14 15 16

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 07?
A.
B.

C.
D.

Answer: C
QUESTION 75
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.vb file?
A. B. C."Calculator.Resources.MessageResources", "Messages")> D."Calculator.Resources.MessageResources.resx", "Messages")>

Answer: C
QUESTION 76
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You plan to deploy the application to a test server.
You need to ensure that during the initial request to the application, the code-behind files for the Web pages are compiled. You also need to optimize the performance of the application.
Which code fragment should you add to the Web.config file?
A.
B.
C.
D.
Answer: B
QUESTION 77
You create a Microsoft ASP.NET AJAX application by using the Microsoft .NET Framework version 3.5.
You attach Microsoft Visual Studio 2008 debugger to the Microsoft Internet Explorer instance to debug the JavaScript code in the AJAX application.

You need to ensure that the application displays the details of the client-side object on the debugger console.
What should you do?
A. Use the Sys.Debug.fail method.
B. Use the Sys.Debug.trace method.
C. Use the Sys.Debug.assert method.
D. Use the Sys.Debug.traceDump method.

Answer: D
QUESTION 78
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application resides on a server named ContosoTest that runs Microsoft IIS 5.0.
You use a computer named ContosoDev to log on to the Contoso.com domain with an account named ContosoUser.
The ContosoTest and ContosoDev servers are members of the Contoso.com domain.
You need to set up the appropriate permission for remote debugging.
What should you do?
A.Set the Remote Debugging Monitor to use Windows Authentication. B.Add the ContosoUser account to the domain Administrators group. C.Add the ContosoUser account to the local Administrators group on the ContosoTest server. D.Change the ASP.NET worker process on the ContosoTest server to run as the local Administrator account.
Answer: C
QUESTION 79
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You plan to monitor the execution of the application at daily intervals.
You need to modify the application configuration to enable WebEvent monitoring.
What should you do?

A.Enable the Debugging in the Web site option in the ASP.NET configuration settings. Modify the Request Execution timeout to 10 seconds. B.Register the aspnet_perf.dll performance counter library by using the following command. regsvr32 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_perf.dll C.Add the following code fragment to the section of the Web.config file of the application. D.Add the following code fragment to the section of the Web.config file of the application.



Answer: D
QUESTION 80
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application is deployed on a Microsoft IIS 6.0 Web server by using the default ASP.NET version 2.0 application pool and Windows Authentication.
The application contains functionality to upload files to a location on a different server.
Users receive an access denied error message when they attempt to submit a file.
You need to modify the Web.config file to resolve the error.
Which code fragment should you use?
A.
B.
C.
D.

Answer: A QUESTION 81

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application contains a mobile Web page.
You add the following StyleSheet control to the Web page.


You need to add a Label control named MyLabel that uses the defined style in the MyStyleSheet StyleSheet control.
Which markup should you use?
A. B. C. D.
Answer: A
QUESTION 82
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application contains the following code segment.
public class CapabilityEvaluator { public static bool ChkScreenSize(System.Web.Mobile.MobileCapabilities cap, string arg) { int screenSize = cap.ScreenCharactersWidth * cap.ScreenCharactersHeight;

return screenSize < int.Parse(arg); } }
You add the following device filter element to the Web.config file.

You need to write a code segment to verify whether the size of the device display is less than 80 characters.
Which code segment should you use?
A.MobileCapabilities currentMobile; currentMobile = Request.Browser as MobileCapabilities; if (currentMobile.HasCapability("FltrScreenSize", "80")) { }
B.MobileCapabilities currentMobile; currentMobile = Request.Browser as MobileCapabilities; if (currentMobile.HasCapability("FltrScreenSize", "").ToString() =="80") { }
C.MobileCapabilities currentMobile; currentMobile = Request.Browser as MobileCapabilities; if (currentMobile.HasCapability("CapabilityEvaluator.ChkScreenSize", "80")) { }
D.MobileCapabilities currentMobile; currentMobile = Request.Browser as MobileCapabilities; if (currentMobile.HasCapability("CapabilityEvaluator.ChkScreenSize", "").ToString() == "80") { }
Answer: A
QUESTION 83
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a class that implements the IHttpHandler interface. You implement the ProcessRequest method by using the following code segment. (Line numbers are included for reference only.)
01 public void ProcessRequest(HttpContext ctx) {
03 }

You need to ensure that the image named Alert.jpg is displayed in the browser when the handler is requested.
Which code segment should you insert at line 02?
A. var sr = new StreamReader(File.OpenRead(ctx.Server.MapPath("Alert.jpg"))); ctx.Response.Pics(sr.ReadToEnd()); sr.Close();
B. var sr = new StreamReader(File.OpenRead(ctx.Server.MapPath("Alert.jpg"))); ctx.Response.Pics("image/jpg"); ctx.Response.TransmitFile(sr.ReadToEnd()); sr.Close();
C. ctx.Response.ContentType = "image/jpg"; FileStream fs = File.OpenRead(ctx.Server.MapPath("Alert.jpg")); int b; while ((b = fs.ReadByte()) != -1) {
ctx.Response.OutputStream.WriteByte((byte)b); } fs.Close();
D. ctx.Response.TransmitFile("image/jpg"); FileStream fs = File.OpenRead(ctx.Server.MapPath("Alert.jpg")) int b; while ((b = fs.ReadByte()) != -1) {
ctx.Response.OutputStream.WriteByte((byte)b); } fs.Close();

Answer: C
QUESTION 84
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application uses a set of general-purpose utility classes that implement business logic. These classes are modified frequently.
You need to ensure that the application is recompiled automatically when a utility class is modified. What should you do?
A.Create the Web application by using a Microsoft Visual Studio ASP.NET Web Application project. Add the utility classes to the root folder of the Web application.
B.Create the Web application by using a Microsoft Visual Studio ASP.NET Web site. Add the utility classes to the root folder of the Web application.
C.Create the Web application by using a Microsoft Visual Studio ASP.NET Web Application project. Add the utility classes to the App_Code subfolder of the Web application.

D.Create the Web application by using a Microsoft Visual Studio ASP.NET Web site. Add the utility classes to the App_Code subfolder of the Web application.

Answer: D
QUESTION 85
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You add a Web page named HomePage.aspx in the application. The Web page contains different controls.
You add a newly created custom control named CachedControl to the Web page.
You need to ensure that the following requirements are met:

The custom control state remains static for one minute
The custom control settings do not affect the cache settings of other elements in the Web page
What should you do?
A.Add the following code fragment to the Web.config file of the solution. B.Add the following code fragment to the Web.config file of the solution.
C.Add a class named ProfileCache that inherits from the ConfigurationSection class to the HomePage.aspx.cs
page.
Add the following to the Web.config file of the solution.





D.Add a class named ProfileCache that inherits from the ConfigurationSection class to the HomePage.aspx.cs page. Add the following code fragment to the Web.config file of the solution.

Answer: A
QUESTION 86
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Web page that has a GridView control named GridView1. The GridView1 control displays the data from a database named Region and a table named Location.
You write the following code segment to populate the GridView1 control. (Line numbers are included for reference only.)
01 protected void Page_Load(object sender, EventArgs e) {
02 string connstr;
03 ...
04 SqlDependency.Start(connstr);
05 using (var connection = new SqlConnection(connstr)) {
06 var sqlcmd = new SqlCommand();
07 DateTime expires = DateTime.Now.AddMinutes(30);
08 SqlCacheDependency dependency = new SqlCacheDependency("Region", "Location");
10 Response.Cache.SetExpires(expires);
11 Response.Cache.SetValidUntilExpires(true);
12 Response.AddCacheDependency(dependency);
14 sqlcmd.Connection = connection;
15 GridView1.DataSource = sqlcmd.ExecuteReader();
16 GridView1.DataBind();
17 }
18 }

You need to ensure that the proxy servers can cache the content of the GridView1 control. Which code segment should you insert at line 13?

A. Response.Cache.SetCacheability(HttpCacheability.Private)
B. Response.Cache.SetCacheability(HttpCacheability.Public)
C. Response.Cache.SetCacheability(HttpCacheability.Server)
D. Response.Cache.SetCacheability(HttpCacheability.ServerAndPrivate)

Answer: B
QUESTION 87
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application allows users to post comments to a page that can be viewed by other users.
You add a SqlDataSource control named SqlDS1. You write the following code segment. (Line numbers are included for reference only.)
01 private void SaveComment() { 02 string ipaddr; 04 SqlDS1.InsertParameters["IPAddress"].DefaultValue = ipaddr; 05 // ... 06 SqlDS1.Insert(); 07 }
You need to ensure that the IP Address of each user who posts a comment is captured along with the user's comment.
Which code segment should you insert at line 03?
A. ipaddr = Server("REMOTE_ADDR").ToString();
B. ipaddr = Session("REMOTE_ADDR").ToString();
C. ipaddr = Application("REMOTE_ADDR").ToString();
D. ipaddr = Request.ServerVariables("REMOTE_ADDR").ToString();

Answer: D
QUESTION 88
You develop an ASP.NET Web application that references an assembly named CustomControls.dll. You test the application on a staging Web server that runs
IIS 6.0 and verify that the application functions correctly.
You deploy the application to a production Web server. When you attempt to browse the application, you

encounter the following error:

Could not load file or assembly 'CustomControls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
You need to identify the cause of the error. What should you do on the production server? (More than one answer choice may achieve the goal. Select the BEST answer.)
A.Enable assembly bind failure logging, and then launch the Assembly Binding Log Viewer (Fuslogvw.exe). B.Open the application root directory and examine the contents of the \bin directory. C.Add the following element to the Web.config file: D.In IIS Manager, examine the application pool configuration.

Answer: A
QUESTION 89
You create and deploy an intranet application that uses ASP.NET membership and roles. The application master page includes a TreeView control that displays
navigation links retrieved from a file named Web.sitemap.
Users who are not members of the Admins role receive an "Access is Denied" message when they attempt to follow links to pages within a restricted folder named Admin.
You need to ensure that the TreeView control displays navigation links only to pages that the current user is authorized to access. What should you do? (More than one answer choice may achieve the goal. Select the BEST answer.)
A.In the Web.sitemap file, add the roles="Admins" attribute to entries for pages that are stored in the Admin folder. B.In the code-behind file for the master page, add a method that handles the SiteMap.SiteMapResolve event. C.In the Web.sitemap file, remove entries for pages that are stored in the Admin folder. D.In the Web.config file, apply the securityTrimmingEnabled="true" attribute to the default site-map provider.

Answer: D
QUESTION 90
You are developing an ASP.NET Web page that returns search results from a Microsoft SQL Server database. Each search result will be displayed in a custom layout that spans multiple lines. The Web page must meet the following requirements:

Display up to 50 search results at a time.
Allow users to edit records directly within the search results.
Allow users to page through results if the search returns more than 50 results.
You need to meet the requirements.
What should you do? (More than one answer choice may achieve the goal. Select the BEST answer.)
A.Add a GridView control to the Web page and set its AllowPaging property to True. B.Add a FormView control to the Web page and set its AllowPaging property to True. C.Add a ListView control and a DataPager control to the Web page. Set the value of the PagedControlID
property of the DataPager control to the ID of the ListView control. D.Add a Repeater control to the Web page and assign an instance of the PagedDataSource class to its DataSource property.

Answer: C
QUESTION 91
You are developing a Web application.
When a user logs on to the Web site, the application queries a Microsoft SQL Server database for current orders associated with that user.
You need to store the query results so that pages in the site can access the original result set only until the user logs out.
What should you do? (More than one answer choice may achieve the goal. Select the BEST answer.)
A. Pass the object from page to page by using a HiddenField control on each page.
B. Cache the object and expire the cache when the user logs out.
C. Store the query result in a Session variable.
D. Store the query result in an Application variable.
Answer: C
QUESTION 92
You are developing an ASP.NET Web site that will be viewed by an international audience.
The development team creates resource files that include language-specific translations for each text string

that will be displayed in the user interface.
You need to ensure that all ASP.NET pages in the site display the text strings that correspond to the first language specified in the client browser.
What should you do? (More than one answer choice may achieve the goal. Select the BEST answer.)
A. Override the InitializeCulture() method in the code-behind file of each .aspx file.
B. Add the following entry to the Web.config file:
C. Add the following directive to each .aspx file: <%@ Page Culture="auto" UICulture="auto" %>
D. Store the resource files in the App_Data subfolder of the Web site.

Answer: B
QUESTION 93
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a product information page that contains the following control.

You declare a string variable named xmlFragment that contains the following XML fragment.



You need to display the prices for the two products from the XML fragment. Which code segment should you use?
A. var xmlStream = new StringReader(xmlFragment); var ds = new DataSet("Product"); ds.ReadXml(xmlStream); grdDisplay.DataSource = ds.Tables[0]; grdDisplay.DataBind();
B. var xmlStream = new StringReader(xmlFragment); var ds = new DataSet("Product"); ds.InferXmlSchema(xmlStream, null); ds.ReadXml(xmlFragment);

grdDisplay.DataSource = ds.Tables[0]; grdDisplay.DataBind();
C. var xdd = new XmlDataDocument(); xdd.LoadXml(xmlFragment); grdDisplay.DataSource = xdd.DataSet.Tables[0]; grdDisplay.DataBind();
D. var ds = new DataSet("Product"); var xdd = new XmlDataDocument(ds); xdd.LoadXml(xmlFragment); grdDisplay.DataSource = ds.Tables[0]; grdDisplay.DataBind();

Answer: A
QUESTION 94
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
You write the following code segment.
namespace CommonControls { public class MyControl : WebControl { //... } }
You include a MyControl custom server control named MyControl1 on the Web page by using the following code fragment. (Line numbers are included for reference only.)
02
04
You need to add a directive that enables you to use custom control on the Web page.
Which code fragment should you add at line 01?
A. <%@ Assembly Name=" MyControl " Src=" MyControl " %>
B. <%@ Register namespace=" CommonControls " %>
C. <%@ Register namespace=" CommonControls " tagprefix ="custom" %>
D. <%@ Import Namespace=" CommonControls " %>
Answer: C QUESTION 95

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a Web form by using ASP.NET AJAX.
The Web form contains the following code fragment. (Line numbers are included for reference only.)
01
02 03 05
06
The application invokes the assignButtonEvents Javascript function during page initialization. In the function, you plan to attach the buttonClick event handler to the Click event of the btnSubmit Button control.
You need to ensure that the following tasks are performed:

The contextObject object is passed as an event argument. The ContextData property of the contextObject object is used to display a message box in the buttonClick function.
What should you do?
A. Insert the following code segment at line 08. $addHandlers($get('btnSubmit'), {click:buttonClick}, contextObject);
Insert the following code segment at line 12.
alert(this.ContextData);
B. Insert the following code segment at line 08. $addHandlers($get('btnSubmit'), {click:buttonClick}, contextObject);
Insert the following code segment at line 12.
alert(eventElement.ContextData);
C. Insert the following code segment at line 08. $addHandlers($get('btnSubmit'), {onclick:buttonClick}, contextObject);

Insert the following code segment at line 12. alert(eventElement.ContextData);
D. Insert the following code segment at line 08. $addHandlers($get('btnSubmit'), {onclick:buttonClick}, contextObject);
Insert the following code segment at line 12. alert(this.ContextData);

Answer: A
QUESTION 96
You create a Microsoft ASP.NET Web application by using the Microsoft .NET Framework version 3.5.
You use a state server named MyStateServer to enable session state for the application. The MyStateServer state server manages state for eight other Web applications.
You discover that the Web application receives a high number of timeout errors.
The SessionState element for the Web application is currently configured in the following manner.

You need to reduce the number of timeout errors. What should you do?
A. Add a non-default value for the sqlCommandTimeout attribute.
B. Add a non-default value for the timeout attribute.
C. Set the regenerateExpiredSessionId to true.
D. Add a non-default value for the stateNetworkTimeout attribute.

Answer: D
QUESTION 97
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You plan to create a Web form to validate credit card information. You write the following code fragment for the Web form.


You need to implement the ValidateCreditCard method in the code-behind page class that validates the credit card number.
Which code segment should you use?
A. [ScriptMethod()]
public static bool ValidateCreditCard(string ccNumber) { bool isValid = CreditCardAuthority.ValidateCard(ccNumber); return isValid;
}
B. [ScriptMethod()]
public bool ValidateCreditCard(string ccNumber) { bool isValid = CreditCardAuthority.ValidateCard(ccNumber); return isValid;
}
C. [WebMethod()]
public bool ValidateCreditCard(string ccNumber) { bool isValid = CreditCardAuthority.ValidateCard(ccNumber); return isValid;
}
D. [WebMethod()]
public static bool ValidateCreditCard(string ccNumber) { bool isValid = CreditCardAuthority.ValidateCard(ccNumber); return isValid;
}
Answer: D
QUESTION 98

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The Web page has a control named PayerForm that contains a TextBox control named PayerID. The PayerID TextBox control accepts the ID of the current payer.
You need to ensure that the following requirements are met: The PayerID TextBox value is validated against a specific format without additional postbacks.
The PayerID TextBox value is validated against a database. Which three actions should you perform? (Each correct answer presents part of the solution. Choose three.)
A.Add the following attribute to the CustomValidator control. EnableClientScript="false" B.Add the following attribute to the RegularExpressionValidator control. EnableClientScript="false" C.Add the following attribute to the CompareValidator control. EnableClientScript="true"
D.Add the following code fragment to the Web page.
E.Add the following code fragment to the Web page.
F.Add the following code fragment to the Web page.

Answer: ADE
QUESTION 99
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You store the following XML fragment in a string variable named xmlFragment in a Web form.

You need to display the value of the price attribute for each Product element that is contained in a ListBox control named lstPrices. Which code segment should you use?

A. XElement element = XElement.Parse(xmlFragment); var lst = from prods in element.Elements("Product") select prods.Attribute("price").Value; lstPrices.DataSource = lst; lstPrices.DataBind();
B. var doc = new XmlDocument(); doc.LoadXml(xmlFragment); foreach (XmlNode price in doc.SelectNodes("//price")) {
lstPrices.Items.Add(price.ToString()); }
C. var reader = new XmlTextReader(new StringReader(xmlFragment)); XNode node = XElement.ReadFrom(reader); var lst = from prods in node.ElementsAfterSelf("Product") select prods.Attribute("price").Value; lstPrices.DataSource = lst; lstPrices.DataBind();
D. var doc = new XmlDocument(); doc.LoadXml(xmlFragment); foreach (XmlNode price in doc.SelectNodes("Products/price")) {
lstPrices.Items.Add(price.Value); }
Answer: A
QUESTION 100
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a custom-templated server control.
You need to ensure that the child controls of the server control are uniquely identified within the control hierarchy of the page.
Which interface should you implement?
A. The ITemplatable interface
B. The INamingContainer interface
C. The IRequiresSessionState interface
D. The IPostBackDataHandler interface
Answer: B QUESTION 101

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a set of resource files. The files contain localized text values for the controls in the application.
You need to ensure that each page in the application uses the localized text values. What should you do?
A.Add the resource files to the root folder of the application. Use explicit resource expressions for each control that has to be localized.
B.Add the resource files to the App_GlobalResources folder of the application. Use explicit resource expressions for each control that has to be localized.
C.Add the resource files to the App_LocalResources folder of the application. Use explicit resource expressions for each control that has to be localized.
D.Add the resource files to the App_GlobalResources folder of the application. Add a meta:resourcekey attribute to the markup for each control that has to be localized.

Answer: B
QUESTION 102
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application uses a mobile Web form named Default.aspx. You write the following code segment. (Line numbers are included for reference only.)
01 MobileCapabilities curMobile; 02 curMobile = Request.Browser as MobileCapabilities;
The Web form contains a method named SetWmlSpecificInfo.
You need to ensure that each time the Web form is browsed from a browser that supports WML, the SetWmlSpecificInfo method is called.
Which code segment should you insert at line 03?
A. if (curMobile.IsMobileDevice) {
SetWmlSpecificInfo() }
B. if (curMobile.Browser.StartsWith("Mobile:wap/wml")) {
SetWmlSpecificInfo() }
C. if (curMobile.Platform == "text/vnd.wap.wml") { SetWmlSpecificInfo();

}
D. if (curMobile.PreferredRenderingMime == "text/vnd.wap.wml") {
SetWmlSpecificInfo(); }

Answer: D
QUESTION 103
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application is tested by 50 client computers. A high volume of Trace messages is generated. You need to ensure that the following requirements are met:

The Trace information is sent only to the trace.axd file. The trace.axd file contains the latest trace information from a maximum of 10 last requests. The trace.axd file is available only on the host Web server. What should you add to the Trace element in the Web.config file?
A. writeToDiagnosticsTrace="false" and pageOutput="true " and localOnly="true"
B. requestLimit="10" and pageOutput="true" and localOnly="true"
C. requestLimit="10" and pageOutput="false" and localOnly="true"
D. mostRecent="true" and pageOutput="false" and localOnly="true"

Answer: D
QUESTION 104
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a class that contains the following code segment. (Line numbers are included for reference only.)
01 public object GetCachedProducts(SqlConnection conn) { 02 if (Cache("products") Is Nothing) { 03 var cmd = new SqlCommand("SELECT * FROM Products", conn); 04 conn.Open(); 05 Cache.Insert("products", GetData(cmd)); 06 conn.Close(); 07 } 08 return Cache("products"); 09 } 10 public object GetData(SqlCommand prodCmd) { 12 }

Each time a Web form has to access a list of products, the GetCachedProducts method is called to provide this list from the Cache object.
You need to ensure that the list of products is always available in the Cache object.
Which code segment should you insert at line 11?
A. SqlDataReader dr; prodCmd.CommandTimeout = int.MaxValue; return prodCmd.ExecuteReader();
B. dr = prodCmd.ExecuteReader(); return dr;
C. var da = new SqlDataAdapter(); da.SelectCommand = prodCmd; var ds = new DataSet(); return ds.Tables[0]
D. var da = new SqlDataAdapter(prodCmd); var ds = new DataSet(); da.Fill(ds); return ds;

Answer: D
QUESTION 105
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You write the following code segment in the code-behind file to create a Web form. (Line numbers are included for reference only.)
01 string strQuery = "select * from Products; select * from Categories"; 02 var cmd = new SqlCommand(strQuery, cnn); 03 cnn.Open(); 04 SqlDataAdapter rdr = cmd.ExecuteReader(); 06 rdr.Close(); 07 cnn.Close();
You need to ensure that the gvProducts and gvCategories GridView controls display the data that is contained in the following two database tables:

The Products database table The Categories database table

Which code segment should you insert at line 05?
A. gvProducts.DataSource = rdr; gvProducts.DataBind(); gvCategories.DataSource = rdr; gvCategories.DataBind();
B. gvProducts.DataSource = rdr; gvCategories.DataSource = rdr; gvProducts.DataBind(); gvCategories.DataBind();
C. gvProducts.DataSource = rdr; rdr.NextResult(); gvCategories.DataSource = rdr; gvProducts.DataBind(); gvCategories.DataBind();
D. gvProducts.DataSource = rdr; gvCategories.DataSource = rdr; gvProducts.DataBind(); rdr.NextResult(); gvCategories.DataBind();
Answer: D
QUESTION 106
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a custom control named OrderForm.
You write the following code segment.
public delegate void CheckOrderFormEventHandler(EventArgs e);
private static readonly object CheckOrderFormKey = new object();
public event CheckOrderFormEventHandler CheckOrderForm {
add { Events.AddHandler(CheckOrderFormKey, value); }
remove { Events.RemoveHandler(CheckOrderFormKey, value); } }
You need to provide a method that enables the OrderForm control to raise the CheckOrderForm event.

Which code segment should you use?
A.protected virtual void OnCheckOrderForm(EventArgs e) { CheckOrderFormEventHandler checkOrderForm = (CheckOrderFormEventHandler)Events[typeof(CheckOrderFormEventHandler)]; if (checkOrderForm != null)
checkOrderForm(e); }
B.protected virtual void OnCheckOrderForm(EventArgs e) { CheckOrderFormEventHandler checkOrderForm = Events[CheckOrderFormKey] as CheckOrderFormEventHandler; if (checkOrderForm != null)
checkOrderForm(e); }
C.CheckOrderFormEventHandler checkOrderForm = new CheckOrderFormEventHandler(checkOrderFormCallBack); protected virtual void OnCheckOrderForm(EventArgs e) {
if (checkOrderForm != null) checkOrderForm(e); }
D.CheckOrderFormEventHandler checkOrderForm = new CheckOrderFormEventHandler(checkOrderFormCallBack); protected virtual void OnCheckOrderForm(EventArgs e) {
if (checkOrderForm != null) RaiseBubbleEvent(checkOrderForm, e); }
Answer: B
QUESTION 107
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Microsoft Windows Communication Foundation (WCF) service that exposes the following service contract. (Line numbers are included for reference only.)
01 [ServiceContract] 02 public interface IBlogService
03 {
04 [OperationContract]
05 [WebGet(ResponseFormat=WebMessageFormat.Xml)]
06 Rss20FeedFormatter GetBlog();
07 }


You configure the WCF service to use the WebHttpBinding class, and to be exposed at the following URL:
http://www.contoso.com/BlogService
You need to store the result of the GetBlog operation in an XmlDocument variable named xmlBlog in a Web form.
Which code segment should you use?
A. string url = @"http: //www.contoso.com/BlogService/GetBlog"; XmlReader blogReader = XmlReader.Create(url); xmlBlog.Load(blogReader);
B. string url = @"http: //www.contoso.com/BlogService"; XmlReader blogReader = XmlReader.Create(url); xmlBlog.Load(blogReader);
C. Uri blogUri = new Uri(@"http: //www.contoso.com/BlogService"); ChannelFactory blogFactory = new ChannelFactory(blogUri); IBlogService blogSrv = blogFactory.CreateChannel(); Rss20FeedFormatter feed = blogSrv.GetBlog(); xmlBlog.LoadXml(feed.ToString());
D. Uri blogUri = new Uri(@"http: //www.contoso.com/BlogService/GetBlog"); ChannelFactory blogFactory = new ChannelFactory(blogUri); IBlogService blogSrv = blogFactory.CreateChannel(); Rss20FeedFormatter feed = blogSrv.GetBlog(); xmlBlog.LoadXml(feed.Feed.ToString());
Answer: A
QUESTION 108
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a page that contains the following control.

You write the following code segment in the code-behind file for the page.
void LoadDate(object sender, EventArgs e) { if (IsPostBack) { calBegin.SelectedDate = (DateTime)ViewState["date"]; }

}
void SaveDate(object sender, EventArgs e) { ViewState["date"] = calBegin.SelectedDate; }
You need to ensure that the calBegin Calendar control maintains the selected date.
Which code segment should you insert in the constructor of the page?
A. this.Load += new EventHandler(LoadDate); this.Unload += new EventHandler(SaveDate);
B. this.Init += new EventHandler(LoadDate); this.Unload += new EventHandler(SaveDate);
C. this.Init += new EventHandler(LoadDate); this.PreRender += new EventHandler(SaveDate);
D. this.Load += new EventHandler(LoadDate); this.PreRender += new EventHandler(SaveDate);

Answer: D
QUESTION 109
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
QUESTION 110
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application contains two HTML pages named ErrorPage.htm and PageNotFound.htm.
You need to ensure that the following requirements are met:

When the userrequests a page that does not exist, the PageNotFound.htm page is displayed.
When any other error occurs, the ErrorPage.htm page is displayed
Which section should you add to the Web.config file?
A.

B.

C.

D.

Answer: B
QUESTION 111
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 client-script function. (Line numbers are included forreference only.)
01 function updateLabelControl(labelId, newText) { var label = $find(labelId);

label.innerHTML = newText; 04 }
The client script function uses ASP.NET AJAX and updates the text of any Label control in the Web form.
When you test the client script function, you discover that the Label controls are not updated. You receive the following JavaScript error message in the browser: "'null' is null or not an object."
You need to resolve the error.
What should you do?
A. Replace line 03 with the following line of code. label.innerText = newText;
B. Replace line 02 with the following line of code. var label = $get(labelId);
C. Replace line 02 with the following line of code. var label = Sys.UI.DomElement.getElementById($get(labelId));
D. Replace line 02 with the following line of code. var label = Sys.UI.DomElement.getElementById($find(labelId));

Answer: B
QUESTION 112
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application uses 10 themes and allows the users to select their themes for the Web page.
When a user returns to the application, the theme selected by the user is used to display pages in the application. This occurs even if the user returns to log on at a later date or from a different client computer.
The application runs on different storage types and in different environments.
You need to store the themes that are selected by the users and retrieve the required theme.
What should you do?
A.Use the Application object to store the name of the theme that is selected by the user. B.Retrieve the required theme name from the Application object each time the user visits a page. C.Use the Session object to store the name of the theme that is selected by the user. D.Retrieve the required theme name from the Session object each time the user visits a page. E.Use the Response.Cookies collection to store the name of the theme that is selected by the user.

F. Use the Request. Cookies collection to identify the the me that was selected by the user each time the user visits a page.
G.Add a setting for the theme to the profile section of the Web.config file of the application. H.Use the Profile.Theme string theme to store the name of the theme that is selected by the user.
I. Retrieve the required theme name each time the user visits a page

Answer: GH
QUESTION 113
You are implementing an EditItemTemplate template for a data-bound Web server control. The control is bound to a data source that contains fields named ID and JobTitle.
You need to implement the following functionality:
Display the ID field value in the IDTextBox control, but prevent changes to the field value from being submitted back to the data source.
Display the JobTitle field value in the JobTitleTextBox control, and allow changes to the field value to be submitted back to the data source.
How should you complete the code segment?
To answer, drag the appropriate code segment or segments to the correct location or locations in the answer area.

Answer:


QUESTION 114
You develop an ASP.NET Web Site project that contains a large number of Web pages.
You need to create and deploy a single assembly that includes all the server-side code for the project. Which actions should you perform in sequence?
To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order.


Answer:


QUESTION 115
You are developing a Web application that exposes a list of news items from an ASP.NET Web service as JSON. You need to consume the Web service by using jQuery 1.4.
How should you complete the client-side script? To answer, drag the appropriate parameter value or values to the correct location or locations in the answer area.


Answer:


QUESTION 116
You are troubleshooting the functionality of a Web page. The Web page instantiates a business object class that calls methods of the System.Diagnostics.Trace class. You need to output trace messages from the business object to the Web page.
How should you configure the application? To answer, drag the appropriate code segment or segments to the correct location or locations in the answer area.


Answer:


QUESTION 117
You are developing a Web application that includes Microsoft Visual C# and Microsoft Visual Basic .NET class files, and Web Services Description Language (WSDL) files. You need to dynamically compile the class files at runtime.
Where should you place the class files?
To answer, select the appropriate folder on the menu.

Answer:


QUESTION 118
You are developing a Web application.
A Web page within the application contains an Age text box. The Age text box has a default value of 21 that you will use when debugging the application.
You need to verify whether the Age value has been modified. If the value has been modified, you need to ensure that the application displays a prompt to break into the debugger. How should you complete the client-side script?
To answer, drag the appropriate code segment or segments to the correct location or locations in the answer area.

Answer:


QUESTION 119
You are developing several Web applications that will display products. You need to create a templated control to display and allow editing of the products. How should you complete the code segment? To answer, drag the appropriate class or classes to the correct location or locations in the answer area.

Answer:


QUESTION 120
You are developing a Web forms application. The application contains a user control named MyControl.ascx. The default Web page contains several Web controls including a PlaceHolder control named PreferencePlaceHolder.
You need to dynamically load the MyControl.ascx user control to the PreferencePlaceHolder control on the default Web page.
How should you complete the method? To answer, drag the appropriate code segment to the correct location or locations in the answer area.

Answer:

QUESTION 121
You are developing a page for a Web application. The page contains a method that returns a list of fruit names. You need to expose the method to the client as a Web service. How should you complete the page markup? To answer, drag the appropriate code segment or segments to the correct location or locations in the answer
area.


Answer:

QUESTION 122
You are implementing a Web page that includes a GridView control. The GridView control is bound to a SqlDataSource control. The data retrieved by the SqlDataSource control changes infrequently.
You need to ensure that the SqlDataSource control will support sorting and paging of data by the GridView control. Which property should you modify?
To answer, select the appropriate property in the answer area.

Answer:


QUESTION 123
You are developing a Web application that exposes a list of blog postings from an ASP.NET Web service as JSON.
You need to consume the Web service by using jQuery 1.4. How should you complete the client-side script?
To answer, drag the appropriate parameter value or values to the correct location or locations in the answer area.


Answer:

QUESTION 124
You develop a public Web application. The application will be deployed from your development computer to a server at a shared hosting provider. The server runs Windows Server 2008.
You need to publish the application to the server. To which location should you publish the application? To answer, select the appropriate publishing option in the dialog box.

Answer:



QUESTION 125
You develop an ASP.NET Web Site project in a folder named C:\WebSite1. The project contains a large number of Web pages and utility classes. The project also includes a strong key file named contoso.snk.
You need to create a single assembly for deployment that includes all the server-side code for the project. You also need to ensure that your development team can be verified as the creator of the assembly.
Which commands should you run in sequence on the development computer?
To answer, move the appropriate commands from the list of commands to the answer area and arrange them in the correct order.

Answer:


QUESTION 126
In Microsoft Visual Studio, you create an ASP.NET Server Control project named DynamicCharts. You add a JavaScript file named Animation.js to the project. You then add the following code segment to the AssemblyInfo.vb file within the same project:
All project components will be distributed as a single assembly named DynamicCharts.dll. You need to ensure that the server controls within the DynamicCharts.dll assembly can reference JavaScript code within the Animation.js file at runtime.
How should you configure the properties of the Animation.js file? To answer, select the appropriate property value in the Properties window.

Answer:


QUESTION 127
You create a registration Web page that requires the user to enter text into two TextBox controls. The controls are named txtEmail and txtConfirmEmail.
To validate that the user enters the same value in each text box, you add a CompareValidator control to the page.
You need to ensure that the CompareValidator error message appears only when the user enters different values in the text boxes.
Which property of the CompareValidator control should you modify? To answer, select the appropriate property in the answer area.

Answer: