Where To Get The 100% Valid 70-515 exam dumps? Come to PassLeader! Here you can get the latest version 70-515 PDF dumps or VCE dumps, we guarantee our 299q 70-515 exam questions are the latest and you will get all the new questions and answers, which are not available on other wesites now! Now try our best 70-515 exam dumps with VCE and you will acquire your 70-515 certification exam immediately.
keywords: 70-515 exam,299q 70-515 exam dumps,299q 70-515 exam questions,70-515 pdf dumps,70-515 practice test,70-515 vce dumps,70-515 study guide,70-515 braindumps,TS: Web Applications Development with Microsoft .NET Framework 4 Exam
QUESTION 161
You are dynamically adding controls to an ASP.NET page in the Page_Load event handler. The page will have text boxes that correspond to the columns in a database table. Each text box will be preceded by a label that displays the name of the corresponding column. You need to create the form so that when the user clicks the label, the corresponding text box is selected for input. What should you do?
A. For each column, output the following HTML, where COL is replaced by the name of the column.
<label>COL</label>
<input name=”COL” type=”text” id=”COL” />
B. For each column, output the following HTML, where COL is replaced by the name of the column.
<label AssociatedControlID=”COL”>COL</label>
<input name=”COL” type=”text” id=”COL” />
C. For each column, create an asp:Label control and a corresponding asp:TextBox that have the same ID.
D. For each column, create an asp:Label control and set the AssociatedControlID to the ID of the corresponding asp:Textbox control.
Answer: D
QUESTION 162
You create a Web page that has an ASP.NET menu. You need to ensure that the menu items are populated from an array of strings in your code-behind file. What should you do?
A. Write a JavaScript function that uses document.write to write out an asp:MenuItem for each string array element.
B. In the Page_Render handler, use Response.Write to write out an asp:MenuItem for each string array element.
C. Set the DataSource attribute of asp:Menu to the name of the array.
D. In the Page_Load handler, create an instance of asp:MenuItem for each string array element, and add each of these instances to the menu’s Items collection.
Answer: D
QUESTION 163
You are implementing a Web page that displays text that was typed by a user. You need to display the user input in the Web page so that a cross-site scripting attack will be prevented. What should you do?
A. Call document.write.
B. Call Response.Write.
C. Call HttpUtility.UrlEncode.
D. Call HttpUtility.HtmlEncode.
Answer: D
QUESTION 164
You are preparing to deploy an ASP.NET application to a production server by publishing the application in Release configuration. You need to ensure that the connection string value that is stored in the web.config file is updated to the production server’s connection string value during publishing. What should you do?
A. Add the following code to the web.config file.
<connectionStrings>
<add name=”DB” connectionString=”Server=ProdServer;Database=ProdDB;Integrated Security=SSPI;” providerName=”Release” />
</connectionStrings>
B. Add the following code to the web.config file.
<connectionStrings>
<add name=”DB” connectionString=”Server=ProdServer;Database=ProdDB;Integrated Security=SSPI;” xdt:Transform=”Replace” xdt:Locator=”Match(name)” />
</connectionStrings>
C. Add the following code to the web.release.config file.
<connectionStrings>
<add name=”DB” connectionString=”Server=ProdServer;Database=ProdDB;Integrated Security=SSPI;” providerName=”Release” />
</connectionStrings>
D. Add the following code to the web.release.config file.
<connectionStrings>
<add name=”DB” connectionString=”Server=ProdServer;Database=ProdDB;Integrated Security=SSPI;” xdt:Transform=”Replace” xdt:Locator=”Match(name)” />
</connectionStrings>
Answer: D
QUESTION 165
You are implementing an ASP.NET application. The application includes a Person class with property Age. You add a page in which you get a list of Person objects and display the objects in a GridView control. You need to add code so that the GridView row is highlighted in red if the age of the person is less than 18. Which GridView event should you handle?
A. RowDataBound
B. RowCommand
C. RowUpdated
D. RowEditing
Answer: A
QUESTION 166
You are implementing an ASP.NET page that will retrieve large sets of data from a data source. You add a ListView control and a DataPager control to the page. You need to ensure that the data can be viewed one page at a time. What should you do?
A. Set the DataPager control’s PageSize property to the number of rows to view at one time.
B. Set the DataPager control’s PagedControlID property to the ID of the ListView control.
C. In the codebehind file, set the DataPager control’s Parent property to the ListView control.
D. In the codebehind file, set the ListView control’s Parent property to the DataPager control.
Answer: B
QUESTION 167
You create a page in an ASP.NET Web application. The page retrieves and displays data from a Microsoft SQL Server database. You need to create a data source that can connect to the database. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. Use an ObjectDataSource control and set its TypeName property to System.Data.SqlClient.SqlConnection.
B. Use a SqlDataSource control and configure its ConnectionString in the web.config file.
C. Use an XmlDataSource control together with an Xml control that represents the database.
D. Use a LinqDataSource control with entity classes that represent the elements in the database.
Answer: BD
QUESTION 168
You are developing an ASP.NET Web application. You create a master page. The master page requires a region where you can add page-specific content by using the ASP.NET page designer. You need to add a control to the master page to define the region. Which control should you add?
A. PlaceHolder
B. ContentPlaceHolder
C. Content
D. Substituition
Answer: B
Explanation:
http://www.scribd.com/selftestengine/d/58942161-MICROSOFT-70-515CSHARP
http://content.yudu.com/Library/A1sxix/BeITCertifiedMicroso/resources/3.htm
http://freedownload.is/pdf/sample-exam-70-515-pdf-questions-790464.html
QUESTION 169
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.)
A. Replace line 3 with the following code segment.
if (FileUpload1.HasFile)
B. Replace line 3 with the following code segment.
if (FileUpload1.FileContent.Length > 0)
C. Insert the following code segment at line 6.
FileUpload1.SaveAs(saveName);
D. Insert the following code segment at line 6.
FileUpload1.FileContent.CopyTo(new FileStream(saveName, FileMode.Open);
Answer: AC
QUESTION 170
You are developing an ASP.NET MVC 2 Web application. The application contains a controller named HomeController, which has an action named Index. The application also contains a separate area named Blog. A view within the Blog area must contain an ActionLink that will link to the Index action of the HomeController. You need to ensure that the ActionLink in the Blog area links to the Index action of the HomeController. Which ActionLink should you use?
A. Html.ActionLink(“Home”, “Index”, “Home”)
B. Html.ActionLink(“Home”, “Index”, “Home”, new {area = “”}, null)
C. Html.ActionLink(“Home”, “Index”, “Home”, new {area = “Blog”}, null)
D. Html.ActionLink(“Home”, “Index”, “Home”, new {area = “Home”}, null)
Answer: B
http://www.passleader.com/70-515.html
QUESTION 171
You are developing a WCF service. The service includes an operation names GetProduct. You need to ensure that GetProduct will accept a POST request and will indicate that the returned data is XML. Which two actions should you perform (Choose 2)
A. Add the WebGet attribute to the service contract.
B. Set WebOperationContext.Current.OutgoingRequest.ContentType to “text/xml” in the GetProduct method.
C. Add the WebInvoke attribute to the service contract.
D. Set WebOperationContext.Current.OutgoingResponse.ContentType to “text/xml” in the GetProduct method.
Answer: CD
QUESTION 172
You are debugging an ASP.NET web page. The page includes the following method:
[WebMethod]
public string GetServerString()
{
…
}
The page also includes the following markup:
<asp:ScriptManager ID=”sm1″ runat=”server” />
The following JavaScript code is used to call the GetServerString method:
function GetString() {
PageMethods.GetServerString(callbackMethod);
}
function callbackMethod(str) {
…
}
The AJAX calls to the GetServerString method are failing. You need to ensure that the AJAX call to the GetServerString method succeeds. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
A. Set the EnablePageMethods property of the ScriptManager control to true.
B. Set the EnablePartialRendering property of the ScriptManager control to true.
C. Change the WebMethod attribute of the GetServerString method to WebMethod(EnableSession=true).
D. Declare the GetServerString method as static.
Answer: AD
QUESTION 173
You are developing an ASP.NET web page. The page includes a DropDownList control. You need to call a client-side function when the user changes the value of the control. Which event should you handle?
A. Click
B. SelectedIndexChanged
C. Change
D. Select
Answer: C
QUESTION 174
You are developing an ASP.NET MVC 2 application. You create a view that will be returned by action methods in multiple controllers. You need to place the view in the appropriate folder. To which subfolder within the Views folder should you add the view?
A. Master
B. Default
C. Shared
D. Common
Answer: C
QUESTION 175
You are debugging an ASP.NET Web application by using the Visual Studio debugger. The application is incorrectly handling a SQL Exception on the login page. You need to break execution where the exception is thrown. What should you do?
A. Enable the User-unhandled option for SqlException in Visual Studio Exception configuration.
B. Set the value of the customErrors element’s mode attribute to “on” in the web.config file.
C. Manually attach the Visual Studio debugger to Internet Explorer.
D. Enable the thrown option for SqlException in Visual Studio exception configuration.
Answer: D
QUESTION 176
You create a Windows Communication Foundation (WCF) service and deploy it with wsHttpBinding and message security enabled. You create an intermediate WCF service for logging messages sent to the primary service. The intermediate service is called via endpoint behaviour. The primary service is receiving malformed data from a client application. You need to enable inspection of the malformed data and prevent message tampering. What do you do?
A. Specify a protection level of None in the contract for the intermediate service.
Disable message and transport security from the client application configuration file.
B. Specify a protection level of Sign in the contract for the intermediate service.
Disable transport security from the client application configuration file.
C. Modify the binding on the intermediate service to use netNamedPipeBinding
D. Modify the binding on the intermediate service to use webHttpBinding
Answer: B
QUESTION 177
You need to ensure that when the button is clicked, both update panels update the tim without generating a postback. What should you do?
A. Add the following marktip to UpdatePanel1.
<Triggers>
<asp:PostBackTrigger ControlID=”btnSave” />
</Triggers>
B. Set the UpdateMode property for the UpdatePanel2 to “Always”
C. Add the following markup to UpdatePanel2
<Triggers>
<asp:AsyncPostBackTrigger ControlID=”btnSave” EventName=”Click” />
</Triggers>
D. Set the UpdateMode property for UpdatePanel2 to “Conditional”
Answer: C
QUESTION 178
You are developing an ASP.NET MVC2 view and controller. The application includes a class names Employee that has a LastName property. The controller requires an action method that will insert an Employee instance into a database. You need to ensure that the data that is submitted is an Employee instance and that a LastName value is given. What should you do?
A. Add a ValidationMessage helper method immediately after the view’s last name TextBox.
Define the action method as follows.
public ActionResult Create(FormCollection employeeToCreate)
{…}
B. Add the Required attribute to the LastName property.
Define the action method as follows.
public ActionResult Create(FormCollection employeeToCreate)
{…}
C. Add the Required attribute to the LastName property.
Define the action method as follows.
public ActionResult Create(Employee employeeToCreate)
{…}
D. Add the ValidationMessage helper method immediately after the views last name TextBox.
Define the action method as follows.
public ActionResult Create(Employee employeeToCreate)
{…}
Answer: C
QUESTION 179
You are developing an ASP.NET MVC 2 Web Application. You need to implement an asynchronous controller named AccountingController, and you must ensure that the export action required proper authorization. Which code segment should you use?
A. public class AccountingController : Controller
{
public void ExportAsync() {…}
[Authorise]
public void ExportCompleted() {…}
}
B. public class AccountingController : AsyncController
{
[Authorise]
public void ExportAsync() {…}
public void ExportCompleted() {…}
}
C. public class AccountingController : AsyncController
{
[Authorise]
public void Export() {…}
}
D. public class AccountingController : Controller
{
[Authorise]
public void ExportAsync() {…}
[Authorise]
public void ExportCompleted() {…}
}
Answer: B
QUESTION 180
You are developing an ASP.NET Web page that uses jQuery validation. The user should enter a valid email address in a text box that has ID txtEmail. The page must display “E-Mail address required” when the user does not enter an address and “Invalid e-mail address” when the user enters an address that is not formatted properly. You need to ensure that the appropriate error message is displayed when the text box does not contain a valid e-mail address. Which two code segments should you add? (Choose 2)
A. txtEmail:
{
messages:
{
required: “E-mail address required”,
email: “Invalid e-mail address”
}
}
B. messages:
{
txtEmail:
{
required: “E-mail address required”,
email: “Invalid e-mail address”
}
}
C. txtEmail:
{
rules:
{
required: true
email: true
}
}
D. rules:
{
txtEmail:
{
required: true
email: true
}
}
Answer: BD
http://www.passleader.com/70-515.html