Microsoft 70-568 Real Exam Questions
UPGRADE: Transition your MCPD Enterprise Application Developer Skills to MCPD Enterprise Application Developer 3.5, Part 1
This exam is the first part of a two-part upgrade process for candidates who are certified as an MCPD Enterprise Application Developer on the .NET Framework 2.0 and want to upgrade their certification to MCPD Enterprise Application Developer on the .NET Framework 3.5.
Questions that contain code will be presented in either VB or C#. Candidates can select one of these languages when they start the exam.
2: 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. <system.web> <pages validateRequest="false"/></system.web>
D.Set the following value in the Machine.config file. <system.web> <pages validateRequest="false"/></system.web>
Correct Answers: C
3: 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
Correct Answers: B
4: 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.
<asp:Repeater ID="rptData" runat="server"
DataSourceID="SqlDataSource1"
ItemDataBound="rptData_ItemDataBound">
<ItemTemplate>
<asp:Label ID="lblQuantity" runat="server"
Text='<%# Eval("QuantityOnHand") %>’ />
</ItemTemplate>
</asp:Repeater>
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 Sub rptData_ItemDataBound(ByVal sender As Object, _
02 ByVal e As RepeaterItemEventArgs)
03
04 If lbl IsNot Nothing Then
05 If Integer.Parse(lbl.Text) < 10 Then
06 lbl.ForeColor = Color.Red
07 End If
08 End If
09 End Sub
You need to retrieve a reference to the lblQuantity Label control into a variable named lbl.
Which code segment should you insert at line 03?
A.Dim lbl As Label = _ TryCast(Page.FindControl("lblQuantity"), Label)
B.Dim lbl As Label = _ TryCast(e.Item.FindControl("lblQuantity"), Label)
C.Dim lbl As Label = _ TryCast(rptData.FindControl("lblQuantity"), Label)
D.Dim lbl As Label = _ TryCast(e.Item.Parent.FindControl("lblQuantity"), Label)
Correct Answers: B
5: 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.<sessionState mode="InProc" cookieless="UseCookies" />
B.<sessionState mode="InProc" cookieless="UseDeviceProfile" />
C.<sessionState mode="SQLServer" cookieless="false" sqlConnectionString="Integrated Security=SSPI;data source=MySqlServer;" />
D.<sessionState mode="SQLServer" cookieless="UseUri" sqlConnectionString="Integrated Security=SSPI;data source=MySqlServer;" />
Correct Answers: C
6: 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.<system.web> <authentication mode="Forms"> <forms loginUrl="login.aspx" /> </authentication> <authorization> <deny users="?" /> </authorization></system.web>
B.<system.web> <authentication mode="Forms"> <forms loginUrl="login.aspx" /> </authentication> <authorization> <deny users="*" /> </authorization></system.web>
C.<system.web> <authentication mode="Windows"> </authentication> <authorization> <deny users="?" /> </authorization></system.web>
D.<system.web> <authentication mode="Windows"> </authentication> <authorization> <deny users="*" /> </authorization></system.web>
Correct Answers: A
7: 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 <tr>
02 <td align="right"><b>Category:</b></td>
03 <td><asp:DropDownList ID="InsertCategoryDropDownList"
04
05 DataSourceID="CategoriesDataSource"
06 DataTextField="CategoryName"
07 DataValueField="CategoryID"
08 RunAt="Server" />
09 </td>
10 </tr>
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 04?
A.SelectedValue='<%# Eval("CategoryID") %>’
B.SelectedValue='<%# Bind("CategoryID") %>’
C.SelectedValue='<%# Eval("CategoryName") %>’
D.SelectedValue='<%# Bind("CategoryName") %>’
Correct Answers: B
8: 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 Dim strQuery As String = "select * from Products;" + _
"select * from Categories"
02 Dim cmd As New SqlCommand(strQuery, cnn)
03 cnn.Open()
04 Dim rdr As SqlDataReader = cmd.ExecuteReader()
05
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 = rdrgvProducts.DataBind()gvCategories.DataSource = rdrgvCategories.DataBind()
B.gvProducts.DataSource = rdrgvCategories.DataSource = rdrgvProducts.DataBind()gvCategories.DataBind()
C.gvProducts.DataSource = rdrrdr.NextResult()gvCategories.DataSource = rdrgvProducts.DataBind()gvCategories.DataBind()
D.gvProducts.DataSource = rdrgvCategories.DataSource = rdrgvProducts.DataBind()rdr.NextResult()gvCategories.DataBind()
Correct Answers: D
Download | Password: certificatexam.com