PrepAway - Latest Free Exam Questions & Answers

You need to ensure that the custom formatting is applied to only the EmailAddress property

You are developing a Asp.net MVC 2 application The following Customer class is rendered by the
Html.DisplayForModel helper method.
public class Customer
{
public string FirstName { get; set;}
public string LastName { get; set;}
public string EmailAddress { get; set;}

}
You create a partial view named Email.ascx in the Views/Shared/DisplayTemplates folder. Email.ascx
performs custom formatting of e-mail addresses. You need to ensure that the custom formatting is
applied to only the EmailAddress property. What should you do?

PrepAway - Latest Free Exam Questions & Answers

A.
Rename Email.ascx to String.ascx.

B.
Add the following attribute to the EmailAddress property.
[DataType(DataType.EmailAddress)]

C.
Add the following attribute tot the EmailAddress property
[UIHint(“Email”)]

D.
Rename Email.ascx to EmailAddress.ascx


Leave a Reply