Web Developer Framework 4.0 Sample Questions – 5

Question: You are implementing an ASP.NET Web site that uses a custom server control named Task. Task is defined as shown in the following list. “Class name: Task “Namespace: DevControls “Assembly: TestServerControl.dll “Base class: System.Web.UI.WebControls.WebControl You copy TestServerControl.dll to the Web site s Bin folder. You need to allow the Task control to be declaratively used on site pages that do not contain an explicit @ Register directive. Which configuration should you add to the web.config file?

  1. <appSettings><add key="Dev:Task"value="DevControls, DevControls.Task"/> </appSettings>
  2. <compilation targetFramework="4.0" explicit="false"><assemblies><add assembly="TestServerControl" /></assemblies> </compilation>
  3. <pages><controls><add assembly="TestServerControl" namespace="DevControls"tagPrefix="Dev"/></controls> </pages>
  4. <pages><tagMapping><add tagType="System.Web.UI.WebControls.WebControl"mappedTagType="DevControls.Task"/></tagMapping> </pages>

Correct Answer: 3


Question: You create an ASP.NET page that contains the following tag.
<h1 id="hdr1" runat="server">Page Name</h1>
You need to write code that will change the contents of the tag dynamically when the page is loaded. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)

  1. this.hdr1.InnerHtml = "Text";
  2. (hdr1.Parent as HtmlGenericControl).InnerText = "Text";
  3. HtmlGenericControl h1 = this.FindControl("hdr1") as HtmlGenericControl;
    h1.InnerText = "Text";
  4. HtmlGenericControl h1 = Parent.FindControl("hdr1") as HtmlGenericControl;
    h1.InnerText = "Text";

Correct Answer: 1,3


Question: You create a Web page that contains drop-down menus that are defined by using div tags in the following code.
<div><div>Menu One</div><div style=" display:none ;"><div><a href ="#">Item One</a></div><div><a href ="#">Item Two</a></div></div> </div> <div><div>Menu Two</div><div style=" display:none ;"><div><a href ="#">Item Three</a></div><div><a href ="#">Item Four</a></div></div> </div>
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?

  1. $(".dropdown-menu").hover(function () {$(".menu-items"). slideDown (100);},function () {$(".menu-items"). slideUp (100);});
  2. $(".dropdown-menu").hover(function () {$(".menu-items", this). slideDown (100);},function ()
  3. {$(".menu-items", this). slideUp (100);});
  4. $(".dropdown-menu").hover(function () {$(this). slideDown (100);},function () {$(this). slideUp (100);});
  5. $(".dropdown-menu").hover(function () {$(this, ".menu-title"). slideDown (100);},function () {$(this, ".menu-title"). slideUp (100);});

Correct Answer: 2


Question: You are implementing an ASP.NET application that makes extensive use of JavaScript libraries. Not all pages use all scripts, and some scripts depend on other scripts. When these libraries load sequentially, some of your pages load too slowly. You need to use the ASP.NET Ajax Library Script Loader to load these scripts in parallel. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

  1. In your site s master page, add a call to Sys.loader.defineScripts to define each of the scripts that are used in the site.
  2. In your site s master page, add a call to Sys.loader.registerScript to define each of the scripts that are used in the site.
  3. In each page that uses scripts, add a call to Sys.get for each script that is needed in that page.
  4. In each page that uses scripts, add a call to Sys.require for each script that is needed in that page.

Correct Answer: 1,4


Question: You create a Web page that contains the following image element.
<img id="myImage" src="/image1.png" />
You need to write a JavaScript function that will dynamically change which image is displayed. The function must be compatible across different browsers. Which code segment should you use?

  1. function changeImage() {myImage.src = "image2.png"; }
  2. function changeImage() {document.getElementById("myImage").src ="image2.png"; }
  3. function changeImage() { getElementById("myImage").src ="image2.png"; }
  4. function changeImage() {window.getElementById("myImage").src ="image2.png"; }

Correct Answer: 2

Tagged . Bookmark the permalink.

4 Responses to Web Developer Framework 4.0 Sample Questions – 5

  1. MyName says:

    Are these questions from latest dumps?

  2. MyName says:

    The answers for Q2 on this page are all mixed with other answers. Shouldn’t it be like this?
    1) this.hdr1.InnerHtml = “Text”;
    2) (hdr1.Parent as HtmlGenericControl).InnerText = “Text”;
    3) HtmlGenericControl h1 =
    this.FindControl(“hdr1”) as HtmlGenericControl;
    h1.InnerText = “Text”;
    4) HtmlGenericControl h1 =
    Parent.FindControl(“hdr1”) as HtmlGenericControl;
    h1.InnerText = “Text”;

Leave a Reply