单项选择题

You create a Web page that contains the following image element.
You need to write a JavaScript function that will dynamically change which image is displayed. Which code segment should you use?()

A.function changeImage() {myImage.src = "image2.png"; }
B.function changeImage() { document.getElementById("myImage").src = "image2.png"; }
C.function changeImage() { getElementById("myImage").src = "image2.png"; }
D.function changeImage() { window.getElementById("myImage").src = "image2.png"; }


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

You create a Web page that contains drop-down menus that are defined by using div tags in the following code. 

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?()

A.$(".dropdown-menu").hover( function () { $(".menu-items").slideDown(100); },function () {   $(".menu-items").slideUp(100); } );
B.$(".dropdown-menu").hover( function () { $(".menu-items", this).slideDown(100); },function (){ $(".menu-items", this).slideUp(100); } );
C.$(".dropdown-menu").hover( function () { $(this)".slideDown(100); }, function () {  $(this).slideUp(100);  } );
D.$(".dropdown-menu").hover( function () { $("this.menu-title",).slideDown(100); },function () {$("this.menu-title",).slideUp(100); } );

3.单项选择题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?()

A.Configure the input control to run on the server. On the submit button, add a server-side OnClick handler that calls CheckCreditCard  and  rejects  the form submission if the input is invalid.
B.On the input control,add an onChange handler that calls CheckCreditCard and cancels the form submission when the  input  is invalid.
C.Configure the input control and the submit button to run on the server. Add a submit_OnClick handler that calls CheckCreditCard  and  rejects  the  form  submission  if  the input is invalid.
D.On the form, add an onSubmit handler that calls CheckCreditCard and cancels the form submission if the input  is invalid.

4.单项选择题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?()

A.Require developers to set EnableViewStateMac to true.
B.Store state in ControlState instead of ViewState.
C.Serialize the state into an Application state entry called "MyControl"
D.Require developers to change the session state mode to SQL Server.

5.多项选择题You are implementing an ASP.NET page that hosts a user control named CachedControl. You need to ensure that the content of the user control is cached for 10 seconds and that it is regenerated when fetched after the 10 seconds elapse. Which two actions should you perform?()

A.Modify the hosting page’s caching directive as follows.
B.Add the following meta tag to the Head section of the hosting page.
C.Add the following caching directive to the hosted control.
D.Add the following caching directive to the hosted control.

7.单项选择题

You are implementing a read-only page that includes the following controls.
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?() 

A.protected void Page_PreInit(object sender, EventArgs e) { if (!IsPostBack) { gvCustomers.DataSource = GetCustomers();  gvCustomers.DataBind(); } }
B.protected void Page_Load(object sender, EventArgs e) { gvCustomers.DataSource = GetCustomers(); gvCustomers.DataBind(); }
C.protected void gvCustomers_DataBinding(object sender, EventArgs e) { gvCustomers.DataSource = GetCustomers(); gvCustomers.DataBind(); }
D.protected void Page_PreRender(object sender, EventArgs e) { if (!IsPostBack) { gvCustomers.DataSource = GetCustomers(); gvCustomers.DataBind(); } }

9.单项选择题You are implementing an ASP.NET Web site that will be accessed by an international audience. The site contains global and local resources for display elements that must be translated into the language that is selected by the user. You need to ensure that the Label control named lblCompany displays text in the user’s selected language from the global resource file. Which control markup should you use?()

A.<asp:Label ID="lblCompany" runat="server" meta:resourcekey="lblCompany" />
B.<asp:Label ID="lblCompany" runat="server" Text="meta:lblCompany.Text" /> 
C.<asp:Label ID="lblCompany" runat="server" Text="<%$ Resources:lblCompanyText %>" />
D.<asp:Label ID="lblCompany" runat="server" Text="<%$ Resources:WebResources, lblCompanyText %>" />

最新试题

You have a master page custom.master ... u create a nested.master page using it ... and then u have content page that uses the nested.master as its master page ...  to get a string prop from custom.master into a label in content page the code u wud use()

题型:单项选择题

In a web page with chechboxes you need to write e jquery that retruns the number checked checkboxes.()

题型:单项选择题

Which event of the GridView class occurs when the Edit button of a row is clicked, but before the GridView control enters edit mode?()

题型:单项选择题

You are developing an ASP.NET MVC 2 Web Application. You need to implement an asynchronous controller named AccountingController, and you must ensure that the export action required proper authorization.Which code segment should you use?()

题型:单项选择题

You are developing an ASP.NET Web application.The application is configured to use the membership and role providers. You need to allow all users to perform an HTTP GET for application resources, but you must allow only the user named Moderator to perform a POST operation.Which configuration should you add to the web.config file?()

题型:单项选择题

You are developing an ASP.NET Web page that uses jQuery validation. The user should enter a valid email address in a text box that has ID txtEmail. The page must display "E-Mail address required" when the user does not enter an address and "Invalid e-mailaddress" when the user enters an address that is not formatted properly. You need to ensure that the appropriate error message is displayed when the text box does not contain a valid e-mail address.  Which two code segments should you add?()

题型:多项选择题

Which class defines the contract that ASP.NET implements to provide membership services using custom membership providers?()

题型:单项选择题

You are developing a Asp.net web application tht includes a panel control that has ID contentsection.You need to add a textBox control to the panel control.()

题型:单项选择题

The page will be posted to the server after one or more image files are selected for upload.You need to ensure that all unuploaded files are saved to the server within one call to a single event handler. What should you do? ()

题型:单项选择题

You have a login.ascx control and to display it in a view which method u would use()

题型:单项选择题