Latest 70-515 Real Exam Download 81-90

Ensurepass

QUESTION 81

You are implementing an ASP.NET page that will retrieve large sets of data from a data source. You add a ListView control and a DataPager control to the page.

You need to ensure that the data can be viewed one page at a time. What should you do?

A. Set the DataPager control’s PageSize property to the number of rows to view at one time.

B. Set the DataPager control’s PagedControlID property to the ID of the ListView control.

C. In the codebehind file, set the DataPager control’s Parent property to the ListView control.

D. In the codebehind file, set the ListView control’s Parent property to the DataPager control.

Answer: B


QUESTION 82

You create a page in an ASP.NET Web application.

The page retrieves and displays data from a Microsoft SQL Server database. You need to create a data source that can connect to the database.

What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

A. Use an ObjectDataSource control and set its TypeName property to System.Data.SqlClient.

SqlConnection.

B. Use a SqlDataSource control and configure its ConnectionString in the web.config file.

C. Use an XmlDataSource control together with an Xml control that represents the database.

D. Use a LinqDataSource control with entity classes that represent the elements in the database.

Answer: BD


QUESTION 83

You are developing an ASP.NET Web application. You create a master page.

The master page requires a region where you can add page-specific content by using the ASP.NET page designer.

You need to add a control to the master page to define the region. Which control should you add?

A. PlaceHolder

B. ContentPlaceHolder

C. Content

D. Substituition

Answer: B


QUESTION 84

You are developing an ASP.NET Web page. You add the following markup to the page.

<asp:FileUpload id="FileUpload1" runat="server" />

<asp:Button id="btnUpload" Text="Upload selected file"

OnClick="btnUpload_Click" runat="server" />

<asp:Label id="lblFeedback" runat="server" />

You add the following code segment to the code-behind. (Line numbers are included for reference only.)

01 protected void btnUpload_Click(object sender, EventArgs e) 02 {

03 if (…)

4 {

5 string saveName = Path.Combine(@"c:uploadedfiles", FileUpload1.

FileName);

06

7 lblFeedback.Text = "File successfully uploaded.";

8 }

9 else

10 {

11 lblFeedback.Text = "File upload failed.";

12 }

13 }

You need to save the uploaded file and display a message to the user that indicates that the upload either succeeded or failed.

Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

A. Replace line 3 with the following code segment.

if (FileUpload1.HasFile)

B. Replace line 3 with the following code segment.

if (FileUpload1.FileContent.Length > 0)

C. Insert the following code segment at line 6.

FileUpload1.SaveAs(saveName);

D. Insert the following code segment at line 6.

FileUpload1.FileContent.CopyTo(new FileStream(saveName, FileMode.Open);

Answer: AC


QUESTION 85

You are developing an ASP.NET MVC 2 Web application.

The application contains a controller named HomeController, which has an action named Index.

The application also contains a separate area named Blog.

A view within the Blog area must contain an ActionLink that will link to the Index action of the HomeController.

You need to ensure that the ActionLink in the Blog area links to the Index action of the HomeController. Which ActionLink should you use?

A. Html.ActionLink("Home", "Index", "Home")

B. Html.ActionLink("Home", "Index", "Home", new {area = ""}, null)

C. Html.ActionLink("Home", "Index", "Home", new {area = "Blog"}, null)

D. Html.ActionLink("Home", "Index", "Home", new {area = "Home"}, null)

Answer: B


QUESTION 86

You are developing an ASP.NET MVC 2 application.

A view contains a form that allows users to submit their first name.

You need to display the value that is submitted, and you must ensure that your code avoids cross-site scripting.

Which code segment should you use?

A. <%: Model.FirstName %>

B. <%= Model.FirstName %>

C. <% Response.Write(Model.FirstName) %>

D. <% Response.Write(HttpUtility.HtmlDecode(Model.FirstName)) %>

Answer: A


QUESTION 87

You are developing an ASP.NET Web page that will display the median value from a sequence of integer values.

You need to create an extension method to compute the median value. Which interface should you add the extension method to?

A. IComparer<T>

B. IEnumerable<T>

C. IEnumerator<T>

D. IEqualityComparer<T>

Answer: B


QUESTION 88

You are creating an ASP.NET Web application.

The application must call a WCF service by using a WCF routing service.

You need to ensure that the application can invoke the target service by using the router endpoint. What should you do?

A. Add a service reference to the router service. In the client binding configuration, specify the address of the router service.

B. Add a service reference to the target service. In the client binding configuration, specify the address of the target service.

C. Add a service reference to the router service. In the client binding configuration, specify the address of

the target service.

D. Add a service reference to the target service. In the client binding configuration, specify the address of the router service.

Answer: D


QUESTION 89

You are developing an ASP.NET Web page. You add a data-bound GridView control.

The GridView contains a TemplateField that includes a DropDownList.

You set the GridViews ClientIDMode property to Static, and you set the ClientIDRowSuffix property to ProductID.

You need to be able to reference individual DropDownList controls from client-side script by using the ProductID.

What should you set the ClientIDMode property of the DropDownList to?

A. AutoID

B. Static

C. Inherit

D. Predictable

Answer: D


QUESTION 90

Gridview: How to change the image of an image control place in each row in a gridview:

A. ItemDataBound

B. Init

C. Prerender

D. Render

Answer: A

Download Latest 70-515 Real Free Tests , help you to pass exam 100%.