News:

SQL Table To C# Entity Model ConverterEntity Model (Class Properties) to SQL Table ConverterIf you encounter any trouble visiting our site, please contact us.

MCPD- Exam 70-515: Web Applications Development with Microsoft .NET Framework 4

  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.

Answer: Answer is c
Further Reading:

Useful resources, GridView, GridView.ClientIDRowSuffix Property

Useful resources,

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.

Answer: Answer is a
Further Reading:

Useful resources, @ MasterType


  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>

Answer: Answer is d

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;

Answer: Answer is b
Further Reading:

Useful resources,, Working with ASP.NET Master Pages Programmatically


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

  1. protected void SelectedLanguageChanged(object sender, EventArgs e) 
    {
     Page.UICulture = ddlLanguage.SelectedValue;
    }
    
  2. protected override void InitializeCulture()
    {
     Page.UICulture = Request.Form["ddlLanguage"];
    }
    
  3. protected void Page_Load(object sender, EventArgs e)
    {
     Page.Culture = Request.Form["ddlLanguage"];
    }
    
  4. protected override void InitializeCulture()
    {
     Page.Culture = ddlLanguage.SelectedValue;
    }
    
Answer: Answer is b
Further Reading:

Useful resources,, Culture and UI Culture for ASP.NET Web Page


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?

  1. 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;
    
  2. 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;
    
  3. 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;
    
  4. 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;
    
Answer: Answer is a

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?

  1. Cache.Insert("ActiveBugs", result, null,DateTime.Now.AddSeconds(60), TimeSpan.FromSeconds(15));
    
  2. 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));
    
  3. 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);
    
  4. 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));
    
Answer: Answer is b
Further Reading:

Useful resources, ASP.NET Caching, Cache Class


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?

 

  1. Bindable

  2. DataObject

  3. Serializable

  4. DataContract

Answer: Answer is c
Further Reading:

Useful resources, SerializableAttribute


  1. protected void Page_Load(object sender, EventArgs e)
    {
    Control userControl = Page.LoadControl("TestUserControl.ascx"); Page.Form.Controls.Add(userControl);
    }
    
  2. protected void Page_Load(object sender, EventArgs e)
    {
    Control userControl = Page.FindControl("TestUserControl.ascx"); Page.Form.Controls.Load(userControl);
    }
    
  3. protected void Page_PreInit(object sender, EventArgs e)
    {
    Control userControl = Page.LoadControl("TestUserControl.ascx"); Page.Form.Controls.Add(userControl);
    }
    
  4. protected void Page_PreInit(object sender, EventArgs e)
    {
    Control userControl = Page.FindControl("TestUserControl.ascx"); Page.Form.Controls.Load(userControl);
    }
    
Answer: Answer is a

<uc:TestUserControl ID="testControl" runat="server"/>
On TestUserControl.ascx, you need to add a read-only member named CityName to return the value "New
York". You also must add code to TestPage.aspx to read this value. Which two actions should you perform?
(Each correct answer presents part of the solution. Choose two.)

  1. Add the following line of code to the TestUserControl.ascx.cs code-behind file.

    public string CityName
    {
    get { return "New York"; }
    }
    
  2. Add the following line of code to the TestUserControl.ascx.cs code-behind file.

    protected readonly string CityName = "New York";
    
  3. Add the following code segment to the TestPage.aspx.cs code-behind file.

    protected void Page_Load(object sender, EventArgs e)
    {
    string s = testControl.CityName;
    }
    
  4. Add the following code segment to the TestPage.aspx.cs code-behind file.

    protected void Page_Load(object sender, EventArgs e)
    {
    string s = testControl.Attributes["CityName"];
    }
    
Answer: Answer is a

Advertisement

BCS Preparation now even more easy. ReadBD is the place where you can find all kind of resources to be successful in BCS,Bank,Islami Bank exam and interview.

Looking for job. Try JobLoader- First ever job search engine in Bangladesh. All open bd jobs now a single mouse click away.

;