You are implementing a read-only page that includes the following controls. runat="server" Text="Button" /> EnableViewState="False"
OnDataBinding="gvCustomers_DataBinding">
You disable view state to improve performance.
You need to ensure that the page is updated to display the latest data when the user clicks the refresh button.
Which code segment should you use?
You create an ASP.NET page named TestPage.aspx that contains validation controls. You need to verify that all input values submitted by the user have been validated by testing the Page.IsValid property.
Which page event should add an event handler to?
You have created an ASP.NET server control named ShoppingCart for use by other developers. Some developers report that the ShoppingCart control does not function properly with ViewState disabled. You want to ensure that all instances of the ShoppingCart control work even if ViewState is disabled.
What should you do?
You are developing a Web page. The user types a credit card number into an input control named cc and clicks a button named submit. The submit button sends the credit card number to the server. A JavaScript library
includes a CheckCreditCard function that returns a value of true if the credit card appears to be valid, based on its checksum.
You need to ensure that the form cannot be used to submit invalid credit card numbers to the server.
What should you do?
You are implementing a Web page that allows users to upload files to a Web server. The page includes a form
that has a Submit button.
You want to restrict uploads so that only files smaller than 1 MB can be uploaded.
What should you do?
You are dynamically adding controls to an ASP.NET page in the Page_Load event handler. The page will have text boxes that correspond to the columns in a database table. Each text box will be preceded by a label that
displays the name of the corresponding column.
You need to create the form so that when the user clicks the label, the corresponding text box is selected for input.
What should you do?
For each column, output the following HTML, where COL is replaced by the name of the column.COL
✘ For each column, create an asp:Label control and a corresponding asp:TextBox that have the same ID. ✘ For each column, create an asp:Label control and set the AssociatedControlID to the ID of thecorresponding asp:Textbox control. ✔
You create a Web page that has an ASP.NET menu. You need to ensure that the menu items are populated from an array of strings in your code-behind file. What should you do?
Write a JavaScript function that uses document.write to write out an asp:MenuItem for each string array
element. ✘ In the Page_Render handler, use Response.Write to write out an asp:MenuItem for each string arrayelement. ✘ Set the DataSource attribute of asp:Menu to the name of the array. ✘ In the Page_Load handler, create an instance of asp:MenuItem for each string array element, and add eachof these instances to the menu's Items collection. ✔
You create a Web page that contains drop-down menus that are defined by using div tags in the following code.
Menu One
Menu Two
You need to write a JavaScript function that will enable the drop-down menus to activate when the user positions the mouse over the menu title.
Which code segment should you use?
You create a Web page that contains the following div.
You have a JavaScript array named imageurls that contains a list of image URLs. You need to write a JavaScript function that will insert images from the URLs into target.
Which code segment should you use?