Question: DUE TODAY: Need Help with my ASP NET quiz 1.) [________________] attribute is added to ensure two properties on a model object have the same

DUE TODAY: Need Help with my ASP NET quiz

1.)

[________________] attribute is added to ensure two properties on a model object have the same value.

2.)

What is the purpose of the following annotation?

[StringLength (120, MinimumLength=10)]

public string Firstname {get; set}

public string Lastname {get;set;}

a. FirstName and LastName can be of length 160 characters

b. FirstName and LastName can be of length 10 characters

c. FirstName can be of length between 10 and 120 character s

d. LastName can be of length between 10 and 120 characters

3.) A Custom Validation attribute can be added by deriving from which base class?

a. AnnotationAttribute

b. ValidationAttribute

c. DataAnnotationAttribute

4.) What is the advantage of ApplyFormatInEditMode=false?

a. there is no advantage

b. avoid parsing value formatted for display, which can lead to errors

c. enable parse value formatted for display, which can avoid errors

d. none of the above

5.)

public string FirstName {get; set;}

public string LastName {get; set;}

If you want to change the display name for the LastName field, you would use

a. [Display(Name="Last Name")]

b. [DisplayName="Last Name"]

c.[Display(LastName="Last Name")]

d. [Display(Label="Last Name")]

6.) [_________________] attribute is used to make a field input mandatory.

7.)

[Range(1,7)]

[Required]

public int numNights {get; set;}

In this code segment, [Range] attribute is used to ______________

8.)The ________________catches all the failed validation rules and places them into the ___________

a. Modelbinder, Modelstate

b. Validation attribute,Data annotation

c. Controller, Error handler

d. None of the above

9.) All validation attributes are present under _______________ namespace

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!