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 tabl ?¤The Categories database tabl | English | Chinese | Japan | Korean | - 46 - Test Information Co., Ltd. All rights reserved. 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. 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 configuration. Which code fragment should you use?()
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a Web form by using ASP.NET AJAX. The Web form contains the following code fragment. (Line numbers are included for reference only.) | English | Chinese | Japan | Korean | - 149 - Test Information Co., Ltd. All rights reserved. 01 02 03 Sys.Application.add_init(initComponents); 04 05 function initComponents() { 06 07 } 08 09 10 11 13 You need to create and initialize a client behavior named MyCustomBehavior by using the initComponents function. You also need to ensure that MyCustomBehavior is attached to the TextBox1 Textbox control. Which code segment should you insert at line 06?()
You are implementing an ASP.NET MVC 2 Web application. A controller contains the following code. The first Edit action displays the user whose details are to be edited, and the second Edit action is called when the Save button on the editing form is clicked to update the user details. An exception is thrown at run time stating that the request for action Edit is ambiguous. You need to correct this error and ensure that the controller functions as expected.What are two possible ways to achieve this goal?()
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: ’ /> 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: 01 protected void rptData_ItemDataBound(object sender, 02 RepeaterItemEventArgs e) 03 { 04 ► 05 if(lbl != null) 06 if(int.Parse(lbl.Text) < 10) 07 lbl.ForeColor = Color.Red; 08 } You need to retrieve a reference to the lblQuantity Label control into a variable named lbl. 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. 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 exception information in the Event log file Which two actions should you perform?()
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a custom Web user control named SharedControl. The control will be compiled as a library. You write the following code segment for the SharedControl control. (Line numbers are included for reference only.) 01 Protected Overloads Overrides Sub OnInit(ByVal e As EventArgs) 02 MyBase.OnInit(e) 03 04 End Sub All the master pages in the ASP.NET application contain the following directive. <%@ Master Language="VB" EnableViewState="false" %> You need to ensure that the state of the SharedControl control can persist on the pages that reference a master page. Which code segment should you insert at line 03?()
You create an ASP.NET page. The page uses the jQuery $.ajax function to make calls back to the server in several places. You add the following div element to the page. You need to implement a single error handler that will add error information from all page $.ajax calls to the div named errorInfo. What should you do?()
You are testing an existing ASP.NET page. The page includes a text box. You are able to execute malicious JavaScript code by typing it in the text box and submitting. You need to configure the page to prevent JavaScript code from being submitted by the text box. In the @ Page directive, which attribute should you set to true?()
You are maintaining a Microsoft ASP.NET Web Application that was created by using the Microsoft .NET Framework version 3.5. You obtain the latest version of the project from the source control repository. You discover that an assembly reference is missing when you attempt to compile the project on your computer. You need to compile the project on your computer. What should you do?()