1. Question: You are developing as ASP.NET Web application that will display a list of values. The application must display the values in a tabular format in columns from top to bottom. You need to choose a control that can be bound directly to the list to render this display. Which control should you use?

    A
    Datagrid

    B
    Datalist

    C
    GridView

    D
    DataPager

    Note: Not available
    1. Report
  2. Question: You are developing an ASP.NET web page that includes a Panel Control that has ID ContentSection. You need to add a text box control to the Panel control. Which code segment should you use?

    A
    this.ContentSection.Controls.Add( this.FindControl(contentSection.ID + "asp:TextBox"));

    B
    this.LoadTemplate("asp:TextBox") .InstantiateIN(ContentSection);

    C
    this.RequiresControlState( this.LoadControl(typeof(TextBox),null));

    D
    this.ContentSection.Controls.Add( this.LoadControl(typeof(TextBox),null));

    Note: Not available
    1. Report
  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?

    A
    Add the following directive to TestPage.aspx. <%@ MasterType VirtualPath="~/TestMaster.master" %>

    B
    Add the following directive to TestPage.aspx. <%@ PreviousPageType VirtualPath="~/TestMaster.master" %>

    C
    Set the Strict attribute in the @ Master directive of the TestMaster.master page to true.

    D
    Set the Explicit attribute in the @ Master directive of the TestMaster.master page to true.

    Note: Not available
    1. Report
  4. 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?

    A
    Replace the GridView control with a ListView control.

    B
    Set the ClientIDMode attribute to Predictable in the web.config file.

    C
    Set the ClientIDRowSuffix attribute of each unique GridView control to a different value.

    D
    Set the @ OutputCache directive's VaryByControl attribute to the ID of the GridView control.

    Note: Not available
    1. Report
  5. 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?

    A
    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>

    B
    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>

    C
    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>

    D
    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>

    Note: Not available
    1. Report
  6. 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?

    A
    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;

    B
    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;

    C
    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;

    D
    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;

    Note: Not available
    1. Report
  7. Question: You are implementing an ASP.NET Web site. The site allows users to explicitly choose the display language for the site's Web pages. You create a Web page that contains a DropDownList named ddlLanguage, as shown in the following code segment. <asp:DropDownList ID="ddlLanguage" runat="server" AutoPostBack="True" ClientIDMode="Static" OnSelectedIndexChanged="SelectedLanguageChanged"> <asp:ListItem Value="en">English</asp:ListItem> <asp:ListItem Value="es">Spanish</asp:ListItem> <asp:ListItem Value="fr">French</asp:ListItem> <asp:ListItem Value="de">German</asp:ListItem> </asp:DropDownList> The site contains localized resources for all page content that must be translated into the language that is selected by the user. You need to add code to ensure that the page displays content in the selected language if the user selects a language in the drop-down list. Which code segment should you use?

    A
    protected void SelectedLanguageChanged(object sender, EventArgs e) { Page.UICulture = ddlLanguage.SelectedValue; }

    B
    protected override void InitializeCulture() { Page.UICulture = Request.Form["ddlLanguage"]; }

    C
    protected void Page_Load(object sender, EventArgs e) { Page.Culture = Request.Form["ddlLanguage"]; }

    D
    protected override void InitializeCulture() { Page.Culture = ddlLanguage.SelectedValue; }

    Note: Not available
    1. Report
  8. Question: You are implementing an ASP.NET application that includes the following requirements. Retrieve the number of active bugs from the cache, if the number is present. If the number is not found in the cache, call a method named GetActiveBugs, and save the result under the ActiveBugs cache key. Ensure that cached data expires after 30 seconds. You need to add code to fulfill the requirements. Which code segment should you add?

    A
    int? numOfActiveBugs = (int?)Cache["ActiveBugs"]; if (!numOfActiveBugs.HasValue) { int result = GetActiveBugs(); Cache.Insert("ActiveBugs", result, null, DateTime.Now.AddSeconds(30), Cache.NoSlidingExpiration); numOfActiveBugs = result; } ActiveBugs = numOfActiveBugs.Value;

    B
    int numOfActiveBugs = (int) Cache.Get("ActiveBugs"); if (numOfActiveBugs != 0) { int result = GetActiveBugs(); Cache.Insert("ActiveBugs", result, null, DateTime.Now.AddSeconds(30), Cache.NoSlidingExpiration); numOfActiveBugs = result; } ActiveBugs = numOfActiveBugs;

    C
    int numOfActiveBugs = 0; if (Cache["ActiveBugs"] == null) { int result = GetActiveBugs(); Cache.Add("ActiveBugs", result, null, DateTime.Now.AddSeconds(30), Cache.NoSlidingExpiration, CacheItemPriority.Normal, null); Cache.NoSlidingExpiration, CacheItemPriority.Normal, null); numOfActiveBugs = result; } ActiveBugs = numOfActiveBugs;

    D
    int numOfActiveBugs = (int?)Cache["ActiveBugs"]; if (!numOfActiveBugs.HasValue) { int result = GetActiveBugs(); Cache.Insert("ActiveBugs", result, null, Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(30)); numOfActiveBugs = result; } ActiveBugs = numOfActiveBugs.Value;

    Note: Not available
    1. Report
  9. Question: You are implementing a method in an ASP.NET application that includes the following requirements. *Store the number of active bugs in the cache. *The value should remain in the cache when there are calls more often than every 15 seconds. *The value should be removed from the cache after 60 seconds. You need to add code to meet the requirements. Which code segment should you add?

    A
    Cache.Insert("ActiveBugs", result, null, DateTime.Now.AddSeconds(60), TimeSpan.FromSeconds(15));

    B
    Cache.Insert("Trigger", DateTime.Now, null, DateTime.Now.AddSeconds(60), Cache.NoSlidingExpiration); CacheDependency cd = new CacheDependency(null, new string[] { "Trigger" }); Cache.Insert("ActiveBugs", result, cd, Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(15));

    C
    Cache.Insert("ActiveBugs", result, null, Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(15)); CacheDependency cd = new CacheDependency(null, new string[] { "ActiveBugs" }); Cache.Insert("Trigger", DateTime.Now, cd, DateTime.Now.AddSeconds(60), Cache.NoSlidingExpiration);

    D
    CacheDependency cd = new CacheDependency(null, new string[] { "Trigger" }); Cache.Insert("Trigger", DateTime.Now, null, DateTime.Now.AddSeconds(60), Cache.NoSlidingExpiration); Cache.Insert("ActiveBugs", result, cd, Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(15));

    Note: Not available
    1. Report
  10. Question: You are implementing an ASP.NET application that will use session state in out-of-proc mode. You add the following code. public class Person { public string FirstName { get; set;} public string LastName { get; set;} } You need to add an attribute to the Person class to ensure that you can save an instance to session state. Which attribute should you use?

    A
    Bindable

    B
    DataObject

    C
    Serializable

    D
    DataContract

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd