PrepAway - Latest Free Exam Questions & Answers

Author: seenagape

You need to ensure that the application can consume the target service after the application is deployed

You are creating a client application and configuring it to call a Windows Communication
Foundation (WCF) service. When the application is deployed, it will be configured to send
all messages to a WCF routing service. You need to ensure that the application can
consume the target service after the application is deployed. What should you do?

Which two actions should you perform?

You are developing an ASP.NET Web page.
You add the following markup to the page.
<asp:FileUpload id=”FileUpload1″ runat=”server” />
<asp:Button id=”btnUpload” Text=”Upload selected file”
OnClick=”btnUpload_Click” runat=”server” />
<asp:Label id=”lblFeedback” runat=”server” />
You add the following code segment to the code-behind. (Line numbers are included for reference
only.)
01 protected void btnUpload_Click(object sender,
EventArgs e)
02 {
03 if ()
04 {
05 string saveName = Path.Combine(@”c:\uploadedfiles\”,
FileUpload1.FileName);
06
07 lblFeedback.Text = “File successfully uploaded.”;
08 }
09 else
10 {
11 lblFeedback.Text = “File upload failed.”;
12 }
13 }
You need to save the uploaded file and display a message to the user that indicates that the upload
either succeeded or failed. Which two actions should you perform? (Each correct answer presents
part of the solution. Choose two.)

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 in the 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 correct answer presents part of the solution. Choose two.)

Which two actions should you perform?

You use the following declaration to add a Web user control 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
correct answer presents part of the solution. Choose two.)