PrepAway - Latest Free Exam Questions & Answers

Category: 70-515

Exam 70-515: TS: Web Applications Development with Microsoft .NET Framework 4

What should you do?

You are developing an ASP.NET Web page that contains input controls, validation controls, and a button named btnSubmit.
The page has the following code-behind. (Line numbers are included for reference only.)

01 public partial class _Default : System.Web.UI.Page
02 {
03 protected void SaveToDatabase()
04 {
05
06 }
07
08 protected void btnSubmit_Click(object sender, EventArgs e)
09 {
10
11 }
12 }

You need to ensure that all data that is submitted passes validation before the data is saved in a database.
What should you do?

What should you do?

You are developing an ASP.NET Web application.
Application data is stored in a Microsoft SQL Server 2008 database.
You configure a connection string named cnnContoso.
The application must cache the data that is returned from the database by using this connection string.
You need to ensure that the application checks the database every 10 seconds.
What should you do?

Which two actions should you perform?

You are developing an ASP.NET Web service.
The following code segment implements the service. (Line numbers are included for reference only.)

01 [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
02 public class ProductService : System.Web.Services.WebService
03 {
04 [WebMethod]
05 public Product GetProduct(string name)
06 {
07
08 }
09
10 [WebMethod]
11 public Product GetProduct(int id)
12 {
13
14 }
15 }

You need to ensure that both GetProduct methods can be called from a Web client.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

Which method of the FieldTemplateUserControl class should you override in the BooleanField class?

You are developing an ASP.NET Dynamic Data Web application.
Boolean fields must display as Yes or No instead of as a check box.
You replace the markup in the default Boolean field template with the following markup.

<asp:Label runat=”server” ID=”label” />

You need to implement the code that displays Yes or No.
Which method of the FieldTemplateUserControl class should you override in the BooleanField class?

What should you do?

You are developing 3n ASP.NET Web page.
The page includes the following EntityDataSource control.

<asp:EntityDataSource ID=”EntityDataSourcel” runat=”server”
ConnectionString=”name=AdventureWorksEntities”
DefaultContainerName=”AdventureWorksEntities” EnableFlattening= “False” EntitySetName=”Products” />

The page must filter the data that is displayed in a grid based on a query string parameter named ProductPrefix. The grid must display products whose ProductName starts with the query string value.
You need to ensure that the page generates the appropriate database query.
What should you do?

What should you do?

You are developing an ASP.NET Dynamic Data Web application.
The application uses entities from a global library named Entities.
The Application_Start event contains the following code segment.

DefaultModel.RegisterContext(typeof(
Entities.MyDBDataContext), new ContextConfiguration() {
ScaffcidAilTafcies = false });

You need to ensure that the application shows the Order and Customer entities and hides all other entities.
What should you do?

Which code segment should you add at line 06?

You are developing an ASP.NET Web page.
The page contains the following markup.

<asp:GridView ID=”gvModels” runat=”server” onrowdatabound=”gvModels_RowDataBound” AutoGenerateColumns=”false”>
<Columns>
<asp:BoundField DataField=”Name” HeaderText=”Model” />
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID=”img” runat=”server” />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

The pages code-behind file includes the following code segment. (Line numbers are included for reference only.)

01 protected void gvModels_RowDataBound(object sender, GridViewRowEventArgs e)
02 {
03 if (e.Row.RowType == DataControlRowType.DataRow)
04 {
05 CarModel cm = (CarModel)e.Row.DataItem;
06
07 img.ImageUrl = String.Format(“images/{0}.jpg”, cm.ID);
08
09 }
10 }

You need to get a reference to the Image named img.
Which code segment should you add at line 06?


Page 1 of 1112345...10...Last »