Web Developer Framework 4.0 Sample Questions – 1

Question: You are implementing an ASP.NET application that uses data-bound GridView controls in multiple pages. You add JavaScript code to periodically update specific types of data items in these GridView controls. You need to ensure that the JavaScript code can locate the HTML elements created for each row in these GridView controls, without needing to be changed if the controls are moved from one page to another. What should you do?

  1. Replace the GridView control with a ListView control.
  2. Set the ClientIDMode attribute to Predictable in the web.config file.
  3. Set the ClientIDRowSuffix attribute of each unique GridView control to a different value.
  4. Set the @ OutputCache directive s VaryByControl attribute to the ID of the GridView control.

Correct Answer: 3


Question: You are implementing an ASP.NET application that includes a page named TestPage.aspx. TestPage.aspx uses a master page named TestMaster.master. You add the following code to the TestPage.aspx code-behind file to read a TestMaster.master public property named CityName.
protected void Page_Load(object sender, EventArgs e)
{
string s = Master.CityName;
}

You need to ensure that TestPage.aspx can access the CityName property. What should you do?

  1. Add the following directive to TestPage.aspx.
    <%@ MasterType VirtualPath="~/TestMaster.master" %>
  2. Add the following directive to TestPage.aspx.
    <%@ PreviousPageType VirtualPath="~/TestMaster.master" %>
  3. Set the Strict attribute in the @ Master directive of the TestMaster.master page to true.
  4. Set the Explicit attribute in the @ Master directive of the TestMaster.master page to true.

Correct Answer: 1


Question: 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?

  1. the EnableEventValidation attribute
  2. the ResponseEncoding attribute
  3. the ValidateRequest attribute
  4. the Strict attribute

Correct Answer: 3


Question: You are implementing an ASP.NET page. You add asp :Button controls for Help and for Detail. You add an ASP.NET skin file named default.skin to a theme. You need to create and use a separate style for the Help button, and you must use the default style for the Detail button. What should you do?

  1. Add the following markup to the default.skin file.
    <asp:Button ID="Help"></asp:Button>
    <asp:Button ID="Default"></asp:Button>

    Use the following markup for the buttons in the ASP.NET page.
    <asp:Button SkinID ="Help">Help</asp:Button>
    <asp:Button SkinID ="Default">Detail</asp:Button>
  2. Add the following markup to the default.skin file.
    <asp:Button SkinID ="Help"></asp:Button>
    <asp:Button ID="Default"></asp:Button>

    Use the following markup for the buttons in the ASP.NET page.
    <asp:Button SkinID ="Help">Help</asp:Button>
    <asp:Button SkinID ="Default">Detail</asp:Button>
  3. Add the following code segment to default.skin.
    <asp:Button SkinID ="Help"></asp:Button>
    <asp:Button ></asp:Button>

    Use the following markup for the buttons in the ASP.NET page.
    <asp:Button SkinID ="Help"></asp:Button>
    <asp:Button SkinID ="Default">Detail</asp:Button>
  4. Add the following markup to default.skin.
    <asp:Button SkinID ="Help"></asp:Button>
    <asp:Button ></asp:Button>

    Use the following markup for the buttons in the ASP.NET page.
    <asp:Button SkinID ="Help">Help</asp:Button>
    <asp:Button >Detail</asp:Button>

Correct Answer: 4


Question: You are creating an ASP.NET Web site. The site has a master page named Custom.master. The code-behind file for Custom.master contains the following code segment.
public partial class CustomMaster : MasterPage
{ public string Region {get; set;} ? protected void Page_Load(object sender, EventArgs e){ } }

You create a new ASP.NET page and specify Custom.master as its master page. You add a Label control named lblRegion to the new page. You need to display the value of the master page s Region property in lblRegion. What should you do?

  1. Add the following code segment to the Page_Load method of the page code-behind file.
    CustomMaster custom = this.Parent as CustomMaster;
    lblRegion.Text = custom.Region;
  2. Add the following code segment to the Page_Load method of the page code-behind file.
    CustomMaster custom = this.Master as CustomMaster;
    lblRegion.Text = custom.Region;
  3. Add the following code segment to the Page_Load method of the Custom.Master.cs code-behind file.
    Label lblRegion = Page.FindControl("lblRegion") as Label;
    lblRegion.Text = this.Region;
  4. Add the following code segment to the Page_Load method of the Custom.Master.cs code-behind file.
    Label lblRegion = Master.FindControl("lblRegion") as Label;
    lblRegion.Text = this.Region;

Correct Answer: 2

Tagged . Bookmark the permalink.

2 Responses to Web Developer Framework 4.0 Sample Questions – 1

  1. simi says:

    Hello Sir,
    Can you explain the answer for 1st question?
    becoz in most of the dumps i have seen the answer as ‘3’,but u have mentioned as ‘2’.Which is the correct answer?please explain

    • Hi Simi,
      I am very thankful to you for intimate me my mistake, It was a mistake by me. I am so sorry about that…. Its right answer is #3 but at the time of posting, I don’t know how I choose option #2.
      Now I make it correct and Keep Reading much more and please intimate me if you found any mistake……

Leave a Reply