Which code fragment should you insert at line 10?
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 <script runat="server">
02 protected void Button_Handler(object sender, EventArgs e)
03 {
04 // some long-processing operation.
05 }
06 </script>
07 <div>
08 <asp:ScriptManager ID="defaultScriptManager"
09 runat="server" />
10
11 <asp:UpdatePanel ID="defaultPanel"
12 UpdateMode="Conditional" runat="server">
13 <ContentTemplate>
14 <!– more content here –>
15 <asp:Button ID="btnSubmit" runat="server"
16 Text="Submit" OnClick="Button_Handler" />
17 </ContentTemplate>
18 </asp:UpdatePanel>
19 </div>
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 10?
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:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="updateLabels" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" />
<asp:Label ID="Label2" runat="server" />
<asp:Button ID="btnSubmit" runat="server" Text="Submit" onclick="btnSubmit_Click" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:Label id="Label3" runat="server" />
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?
Which two actions should you perform?
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 exceptioninformation in the Event log file.
Which two actions should you perform? (Each correct answer presents part of the solution.
Choose two.)
Which code segment should you add to the DayParameter class?
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.
<asp:SqlDataSource ID="SqlDataSource1" runat="server" InsertCommand="INSERT INTO [Employee] ([Field1], [Field2], [PostedDate]) VALUES (@Field1, @Field2, @PostedDate)"> <InsertParameters>
<asp:Parameter Name="Field1" />
<asp:Parameter Name="Field2" />
<custom:DayParameter?Name="PostedDate" />
</InsertParameters>
</asp:SqlDataSource>
You write the following code segment to create a custom parameter class.
Public Class DayParameter
Inherits Parameter
End Class
You need to ensure that the custom parameter returns the current date and time.
Which code segment should you add to the DayParameter class?
Which code segment should you use?
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.)
<ServiceContract> _
Public Interface IBlogService
<OperationContract> _
<WebGet(ResponseFormat := WebMessageFormat.Xml)> _
Function GetBlog() As Rss20FeedFormatter
End Interface
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?
Which code segment should you use?
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.
Dim host As New WebServiceHost(GetType(CService), New Uri("http://win/"))
Dim ep As ServiceEndpoint = host.AddServiceEndpoint(GetType(ICService), New WebHttpBinding(), "")
You need to invoke the UpdateCustomerDetails method.
Which code segment should you use?
Which code segment you should insert at line 11?
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 Sub Page_Load(sender As Object, e As EventArgs)
02 Dim objDS__1 As New DataSet()
03 Dim objDA As New SqlDataAdapter(objCmd)
04 objDA.Fill(objDS__1)
05 gridCities.DataSource = objDs
06 gridCities.DataBind()
07 Session("ds") = objDS__1
08 End Sub
09 Protected Sub btnSearch_Click(sender As Object, e As EventArgs)
10
11 End Sub
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 11?
Which code segment should you insert at line 05?
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 tabl The Categories database tabl Which code segment should you insert at line 05?
Which code segment should you insert at line 14?
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 Function GetCachedProducts(conn As sqlConnection) As Object
02
03 If Cache("products") Is Nothing Then
04 Dim cmd As New SqlCommand("SELECT * FROM Products", conn)
05 conn.Open()
06 Cache.Insert("products", GetData(cmd))
07 conn.Close()
08 End If
09 Return Cache("products")
10 End Function
11
12 Public Function GetData(prodCmd As SqlCommand) As Object
13
14 End Function
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 14?
Which code segment should you insert at line 04?
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.
<asp:GridView ID="gvProducts" runat="server" AllowSorting="True" DataSourceID="Products"> </asp:GridView>
<asp:ObjectDataSource ID="Products" runat="server" SelectMethod="GetData" TypeName="DAL" /> </asp:ObjectDataSource>
You write the following code segment for the GetData method of the DAL class. (Line numbers are included for reference only.)
01 Public Function GetData() As Object
02 Dim cnn As New SqlConnection()
03 Dim strQuery As String = "SELECT * FROM Products"
04
05 End Function
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?