Exam 70-562 : Microsoft .NET Framework 3.5, ASP.NET Application Development – 19

Question: You are the newly appointed Web Application Developer at Company.com. You make use of Microsoft .NET Framework 3.5 to create a Microsoft ASP.NET application. Your application contains a Web page with the code below:

<asp:ListBox ID="lb1"AutoPostBack="true" runat="server" /> 

The page contains a code-behind file. The code below is written in the file:

Private Sub BindData(ByVal sender As Object, ByVal e As EventArgs)
lb1.DataSource = CultureInfo.GetCultures(CultureTypes.AllCultures)
lb1.DataTextField = "Names"
lb1.DataBind()
End Sub 

You receive an instruction from management to make sure that the user’s selection in the lb1 ListBox control is retained during postback. You thus need to determine the appropriate code that should be added. What should you do?

  1. You should consider adding AddHandler lb1.SelectedIndexChanged, AddressOf BindData to the constructor of the page.
  2. You should consider adding AddHandler Me.Init, AddressOf BindData to the constructor of the page.
  3. You should consider adding AddHandler Me.PreRender, AddressOf BindData to the constructor of the page.
  4. You should consider adding AddHandler lb1.PreRender, AddressOf BindData to the constructor of the page.

Correct Answer: 2


Question: You work as an application developer at Company.com. The previous developer created a Microsoft ASP.NET application that uses Microsoft .NET Framework 3.5. You check and discover that the application has a DataSourceControl named _DS1. This DataSourceControl is bound to a database table hosted on the local computer. The primary key of the table is the SKU column. The code below is written in the FormView control. (The line numbers is included for reference purposes)
01 <tr>
02 <td align=”right”>
03 <strong>Products:</strong>
04 </td>
05 <td>
06 <asp:DropDownList ID=”_dl1″ DataSourceID=”_DS1″ DataTextField=”SKU”
07 DataValueField=”ProdID” Runat=”server” />
08 </td>
09 </tr>
You have to make sure that when the ProdID field is edited, the changes are updated to the database. What should you identify?

  1. Your best option would be to insert the following code between lines 06 and 07:
    SelectedValue='<%# Bind(“SKU”) %>’
  2. Your best option would be to insert the following code between lines 06 and 07:
    SelectedValue='<%# Bind(“ProdID”) %>’
  3. Your best option would be to insert the following code between lines 06 and 07:
    SelectedValue='<%# Eval(“ProdID”) %>’
  4. Your best option would be to insert the following code between lines 06 and 07:
    SelectedValue='<%# Eval(“SKU”) %>’

Correct Answer: 2


Question: You work as a junior developer at Company.com. You are currently in the process of creating an ASP.NET application. You make use of Microsoft .NET Framework 3.5 to accomplish this. The Finance Department manager informs you that they want to access the results of various queries that they want to do. You thus decide to create a FormView control. The Finance Department manager wants the query to contain the UserID field, the Name field as well as the Location field. The Finance Department manager wants his personnel to be able to view and update the Name field. You thus need to identify the control definition for the Location field in the FormView control. What should you do?

  1. This can be accomplished using the code segment
    <asp:TextBox ID=”LocationTxtBox” Runat=”server” Text='<%# Eval(“Location”) %>’ />
  2. This can be accomplished using the code segment
    <asp:TextBox ID=”LocationTxtBox” Runat=”server” Text='<%# Bind(“Location”) %>’ />
  3. This can be accomplished using the code segment
    <asp:TextBox ID=”LocationTxtBox” Runat=”server” Text=”<%# Eval(“Location”) %>” />
  4. This can be accomplished using the code segment
    <asp:TextBox ID=”LocationTxtBox” Runat=”server” Text=”<%# Bind(“Location”) %>” />

Correct Answer: 2


Question: You work as an application developer at Company.com. You are in the process of creating a Microsoft .ASP.NET application that uses Microsoft .NET Framework 3.5. You create a Microsoft Windows Communication Foundation (WCF) service. This WCF service exposes the folllowing contract. (The line numbers is included for reference purposes)
1 [Contract]
2 public interface IBlogService
3 {
4 [OpContract]
5 [WebGet(ResponseFormat=WebMessageFormat.Xml)]
6 Rss20FeedFormatter GetPost();
7 }
The WCF service is configures to make use of the WebHttpBinding class. The service is exposed at the http://www.Company.com/BlogService URL. The Web form contains an XmlDocument variable named Testxml. You have to make sure that the result of the GetPost operation is stored in Testxml. What should you do?

  1. This can be accomplished by using the subsequent code segment:
    Uri _uri = new Uri(@”http://www.Company.com/BlogService”);
    ChannelFactory<IBlogService> _fact = new ChannelFactory<IBlogService>(_uri);
    IBlogService _srv = _fact.CreateChannel();
    Rss20FeedFormatter _feed = _srv.GetPost();
    Testxml.LoadXml(_feed.ToString());
  2. This can be accomplished by using the subsequent code segment:
    string _url = @”http://www.Company.com/BlogService”;
    XmlReader _reader = XmlReader.Create(_url);
    Testxml.Load(_reader);
  3. This can be accomplished by using the subsequent code segment:
    Uri _uri = new Uri(@”http://www.Company.com/BlogService/GetPost”);
    ChannelFactory<IBlogService> _fact = new
    ChannelFactory<IBlogService>(_uri);
    IBlogService _srv = _fact.CreateChannel();
    Rss20FeedFormatter _feed = _srv.GetPost();
    Testxml.LoadXml(_feed.Feed.ToString());
  4. This can be accomplished by using the subsequent code segment:
    string _url = @”http://www.Company.com/BlogService/GetPost”;
    XmlReader _reader = XmlReader.Create(_url);
    Testxml.Load(_reader);

Correct Answer: 4


Question: You work as an application developer at Company.com. You make use of Microsoft .NET Framework 3.5 to create a Microsoft ASP.NET application that makes use of the ASMX Web service at http://www.Company.com/Services/Calc.asmx. To ensure productivity you need to make sure that Company.com workstations are able to communicate with the ASMX Web service by using the <system.serviceModel> configuration. What should you do?

  1. This can be accomplished by using the code fragment below:
    <client>
    <endpoint address=”http://www.Company.com/Services/Calc.asmx”
    binding=”basicHttpBinding” />
    </client>
  2. This can be accomplished by using the code fragment below:
    <client>
    <endpoint address=”http://www.Company.com/Services/Calc.asmx”
    binding=”wsDualHttpBinding” />
    </client>
  3. This can be accomplished by using the code fragment below:
    <client>
    <endpoint address=”http://www.Company.com/Services/Calc.asmx”
    binding=”ws2007HttpBinding” />
    </client>
  4. This can be accomplished by using the code fragment below:
    <client>
    <endpoint address=”http://www.Company.com/Services/Calc.asmx”
    binding=”wsHttpBinding” />
    </client>

Correct Answer: 1

Tagged . Bookmark the permalink.

Leave a Reply