PrepAway - Latest Free Exam Questions & Answers

Category: 70-567

Exam 70-567: UPGRADE: Transition your MCPD Web Developer Skills to MCPD ASP.NET Developer 3.5

Which code fragment should you use?

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 <system.serviceModel> configuration.
Which code fragment should you use?

What should you do?

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.

<asp:FormView DataSourceID=”ObjectDataSource1″
DataKeyNames=”PhotoID” runat=”server”>
<EditItemTemplate>
<asp:TextBox Text='<%# Bind(“Caption”) %>’ runat=”server”/>
<asp:Button Text=”Update” CommandName=”Update”
runat=”server”/>
<asp:Button Text=”Cancel” CommandName=”Cancel”
runat=”server”/>
</EditItemTemplate>
<ItemTemplate>
<asp:Label Text='<%# Eval(“Caption”) %>’ runat=”server” />
<asp:Button Text=”Edit” CommandName=”Edit” runat=”server”/>
</ItemTemplate>
</asp:FormView>

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?

Which code segment should you insert at line 06?

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;”
02 + “select * from Categories”;
03 SqlCommand cmd = new SqlCommand(strQuery, cnn);
04 cnn.Open();
05 SqlDataReader rdr = cmd.ExecuteReader();
06
07 rdr.Close();
08 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 06?

Which code segment you should insert at line 12?

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.

<asp:TextBox runat=”server” ID=”txtSearch” />
<asp:Button runat=”server” ID=”btnSearch” Text=”Search”
OnClick=”btnSearch_Click” />
<asp:GridView runat=”server” ID=”gridCities” />

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 {
03 DataSet objDS = new DataSet();
04 SqlDataAdapter objDA = new SqlDataAdapter(objCmd);
05 objDA.Fill(objDS);
06 gridCities.DataSource = objDs;
07 gridCities.DataBind();
08 Session[“ds”] = objDS;
09 }
10 protected void btnSearch_Click(object sender, EventArgs e)
11 {
12
13 }

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 12?

What additional step should you perform?

You create a Microsoft ASP.NET 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?

What should you do?

You create a Microsoft ASP.NET 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?

Which code segment should you use?

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You write the following code fragment.

<asp:DropDownList AutoPostBack=”true”
ID=”DropDownList1″ runat=”server”
onselectedindexchanged=
“DropDownList1_SelectedIndexChanged”>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
</asp:DropDownList>

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?

What should you do?

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 <asp:RequiredFieldValidator
02 ID=”rfValidator1″ runat=”server”
03 Display=”Dynamic” ControlToValidate=”TextBox1″
04
05 >
06
07 </asp:RequiredFieldValidator>
08
09 <asp:ValidationSummary DisplayMode=”List”
10 ID=”ValidationSummary1″ runat=”server” />

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?

Which code segment should you insert at line 03?

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 <asp:DetailsView ID=”DetailsView1″ runat=”server”
02 DataSourceID=”LinqDataSource1″
03
04 />
05 <Fields>
06 <asp:BoundField DataField=”MovieID” HeaderText=”MovieID”
07 InsertVisible=”False”
08 ReadOnly=”True” SortExpression=”MovieID” />
09 <asp:BoundField DataField=”Title” HeaderText=”Title”
10 SortExpression=”Title” />
11 <asp:BoundField DataField=”Theater” HeaderText=”Theater”
12 SortExpression=”Theater” />
13 <asp:CommandField ShowDeleteButton=”false”
14 ShowEditButton=”True” ShowInsertButton=”True” />
15 </Fields>
16 </asp:DetailsView>

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 03?


Page 10 of 11« First...7891011