What should you do?

You create Web-based client applications. You create an ASP.NET Web form that lists detailed company information. The company information is stored in a Microsoft SQL Server 2005 database. The Web form displays a drop-down list box that prompts the user to select a company type. On selection of the company type, the name of each company in the selected company type is displayed along with a button next to it. The button permits detailed contact information to be displayed for the company. Each button that is displayed along with a company name has a Text property value that is named View Details. The button is dynamically created based on the company type selected by the user. Each click event of the button is programmed to call a method named ShowDetails. The ShowDetails method displays the company details. The prototype of the Web form is as shown in the following exhibit. (Refer to the Exhibit.) You test the Web form and find that the code seems to function properly. When you display the Web form and click the View Details button, nothing happens. You need to ensure that the Web form responds properly within the minimum amount of time. You also need to minimize coding effort. What should you do?

You create Web-based client applications. You create an ASP.NET Web form that lists detailed company information. The company information is stored in a Microsoft SQL Server 2005 database. The Web form displays a drop-down list box that prompts the user to select a company type. On selection of the company type, the name of each company in the selected company type is displayed along with a button next to it. The button permits detailed contact information to be displayed for the company. Each button that is displayed along with a company name has a Text property value that is named View Details. The button is dynamically created based on the company type selected by the user. Each click event of the button is programmed to call a method named ShowDetails. The ShowDetails method displays the company details. The prototype of the Web form is as shown in the following exhibit. (Refer to the Exhibit.) You test the Web form and find that the code seems to function properly. When you display the Web form and click the View Details button, nothing happens. You need to ensure that the Web form responds properly within the minimum amount of time. You also need to minimize coding effort. What should you do?

A.
In the Postback event handler for the company type drop-down list box, as each View Details button is dynamically created, call the Page_Load method to program the button into the ShowDetails method.

B.
In the Postback event handler for the company type drop-down list-box, as each View Details button is dynamically created, call the Page_Init event handler to program the button into the ShowDetails method.

C.
Create a Web User control that contains a preconfigured button that has the Text property set to View Details. Modify the code written for the control to call the ShowDetails method of the parent form. Instantiate instances of the control as necessary in the Postback event handler for the company type drop-down list box.

D.
Create a Web User control that contains a preconfigured button that has the Text property set to View Details. Modify the code written for the control to call the ShowDetails method of the parent form. Instantiate instances of the control as necessary in the Page_Init event handler for the company type drop-down list box.



Leave a Reply 0

Your email address will not be published. Required fields are marked *