You are implementing an ASP.NET MVC 2 Web application. A controller contains the following code.
Function Edit(ByVal id As Integer) As ActionResult Return View(SelectUserToEdit(id)) End Function
Function Edit(ByVal person As Person) As ActionResult
UpdateUser(person)
Return RedirectToAction("Index")
End Function
The first Edit action displays the user whose details are to be edited, and the second Edit action is called when the Save button on the editing form is clicked to update the user details. An exception is thrown at run time stating that the request
for action Edit is ambiguous. You need to correct this error and ensure that the controller functions as expected. What are two possible ways to achieve this goal? (Each correct answer presents a complete solution. Choose two.)
A. Add the following attribute to the first Edit action.You are implementing an ASP.NET MVC 2 Web application that contains several folders.
The Views/Shared/DisplayTemplates folder contains a templated helper named Score.ascx that performs custom formatting of integer values.
The Models folder contains a class named Player with the following definition.
Public Class Player
Public Property Name As String Public Property LastScore As Integer Public Property HighScore As Integer
End Class
You need to ensure that the custom formatting is applied to LastScore values when the HtmlHelper.DisplayForModel method is called for any view in the application that has a model of type Player. What should you do?
A. Rename Score.ascx to LastScore.ascx.You are developing an ASP.NET Web page that contains input controls, validation controls, and a button named btnSubmit.
The page has the following code-behind. (Line numbers are included for reference only.) 01 Public Class _Default 02 Inherits System.Web.UI.Page 04 Protected Sub SaveToDatabase() 06 End Sub 08 Protected Sub btnSubmit_Click(ByVal sender As Object, 09 ByVal e As EventArgs) Handles btnSubmit.Click 11 End Sub 13 End Class
You need to ensure that all data that is submitted passes validation before the data is saved in a database. What should you do?
A. Add the following method override.Protected Overrides Sub OnInit(ByVal e As EventArgs) MyBase.OnInit(e)If (Page.IsValid) Then Me.SaveToDatabase() End SubYou are implementing an ASP.NET page.
You add asp:Button controls for Help and for Detail.
You add an ASP.NET skin file named default.skin to a theme. You need to create and use a separate style for the Help button, and you must use the default style for the Detail button. What should you do?
A. Add the following markup to the default.skin file.Use the following markup for the buttons in the ASP.NET page.HelpDetailYou are implementing an ASP.NET MVC 2 Web application that contains the following class.
public class DepartmentController : Controller
{
static List
new List
public ActionResult Index()
{
return View(departments);
}
public ActionResult Details(int id)
{
return View(departments.Find(x => x.ID==id));
}
public ActionResult ListEmployees(Department d)
{
List
return View(employees);
}
}
You create a strongly typed view that displays details for a Department instance. You want the view to also include a listing of department employees.
You need to write a code segment that will call the ListEmployees action method and output the results in place.
Which code segment should you use?
You are developing an ASP.NET Web page. The page includes a List
You are developing as ASP.NET Web application that will display a list of values. The application must display the values in a tabular format in columns from top to bottom. You need to choose a control that can be bound directly to the list to
render this display.
Which control should you use?
A. DatagridYou are developing an ASP.NET Web page.
You add the following markup to the page.
You add the following code segment to the code-behind. (Line numbers are included for reference only.)
01 Protected Sub btnUpload_Click(ByVal sender As Object, 02 ByVal e As EventArgs) Handles btnUpload.Click
03 If () Then
04 Dim saveName As String =
05 Path.Combine("c:\uploadedfiles\",
06 FileUpload1.FileName)
08 lblFeedback.Text = "File successfully uploaded."
09 Else
10 lblFeedback.Text = "File upload failed."
11 End If
13 End Sub
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 03 with the following code segment. If (FileUpload1.HasFile) ThenYou are developing an ASP.NET Web service.
The following code segment implements the service. (Line numbers are included for reference only.)
01 ConformsTo:=WsiProfiles.BasicProfile1_1)> 02 Public Class ProductService 03 Inherits System.Web.Services.WebService 05 06 Public Function GetProduct( 07 ByVal name As String) As Product 09 End Function 11 12 Public Function GetProduct( 13 ByVal id As Integer) As Product 15 End Function 17 End Class You need to ensure that both GetProduct methods can be called from a Web client. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
B. Add the Shared modifier on lines 06 and 12.
C. Add the following attribute before line 11.
D. Modify the attribute on line 11 as follows.
ASP.net MVC dotn display a column Using LINQ to SQL class [MetadataType(typeof(ProductMetadata))] public pertial class Product { ... } public class ProductMetadata { ... }
A. Add the following attribute to Product class[DisplayColumn("DiscontinueDate","DiscontinueDate",false)Nowadays, the certification exams become more and more important and required by more and more enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare for the exam in a short time with less efforts? How to get a ideal result and how to find the most reliable resources? Here on Vcedump.com, you will find all the answers. Vcedump.com provide not only Microsoft exam questions, answers and explanations but also complete assistance on your exam preparation and certification application. If you are confused on your 70-515 exam preparations and Microsoft certification application, do not hesitate to visit our Vcedump.com to find your solutions here.