PrepAway - Latest Free Exam Questions & Answers

Category: 70-515 (v.1)

Exam 70-515: TS: Web Applications Development with Microsoft .NET Framework 4 (update August 24th, 2013)

Which two actions should you perform?

You create a Web page named TestPage.aspx and a user control named TestUserControl.ascx.
TestPage.aspx uses TestUserControl.ascx as shown inthe following line of code.
<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 correctanswer presents part of the solution. Choose two.)

Which two actions should you perform?

You use the following declaration to add a Web usercontrol named TestUserControl.ascx to an ASP.NET
page named TestPage.aspx.
<uc:TestUserControl ID=”testControl” runat=”server”/>
You add the following code to the code-behind file of TestPage.aspx.
private void TestMethod()
{

}
You define the following delegate.
public delegate void MyEventHandler();
You need to add an event of type MyEventHandler named MyEvent to TestUserControl.ascx and attach the
page’s TestMethod method to the event.
Which two actions should you perform? (Each correctanswer presents part of the solution. Choose two.)

Which two actions should you perform?

You create a custom server control named Task that contains the following code segment. (Line numbers are
included for reference only.)
01 namespace DevControls
02 {
03 public class Task : WebControl
04 {
05 [DefaultValue(“”)]
06 public string Title { … }
07
08 protected override void RenderContents(HtmlTextWriter output)
09 {
10 output.Write(Title);
11 }
12 }
13 }
You need to ensure that adding a Task control from the Toolbox creates markup in the following format.
<Dev:Task ID=”Task1″ runat=”server” Title=”New Task” />
Which two actions should you perform? (Each correctanswer presents part of the solution. Choose two.)

You need to dynamically add values to the end of the drop-down list

You are implementing an ASP.NET page that includes the following drop-down list.
<asp:PlaceHolder ID=”dynamicControls” runat=”server”>
<asp:DropDownList ID=”MyDropDown” runat=”server”>
<asp:ListItem Text=”abc” value=”abc” />
<asp:ListItem Text=”def” value=”def” />
</asp:DropDownList>
</asp:PlaceHolder>
You need to dynamically add values to the end of the drop-down list.
What should you do?

You need to ensure that the JavaScript for each of these controls that is used in an ASP.NET page…

You are implementing custom ASP.NET server controls.
You have a base class named RotaryGaugeControl and two subclasses named CompassGaugeControl and
SpeedGaugeControl.
Each control requires its own client JavaScript code in order to function properly.
The JavaScript includes functions that are used to create the proper HTML elements for the control.
You need to ensure that the JavaScript for each of these controls that is used in an ASP.NET page is included
in the generated HTML page only once, even if the ASP.NET page uses multiple instances of the given control.
What should you do?

Which code segment should you use?

You are creating an ASP.NET Web site. You create a HTTP module named CustomModule, and you register
the module in the web.config file.
The CustomModule class contains the following code.
public class CustomModule : IHttpModule
{
string footerContent = “<div>Footer Content</div>”;
public void Dispose() {}
}
You need to add code to CustomModule to append the footer content to each processed ASP.NET page.
Which code segment should you use?


Page 3 of 1912345...10...Last »