Question

DUE TODAY: Need Help with my ASP NET quiz 1.) [________________] attribute is added to ensure...

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

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please Note: I have answered the first 4 Questions, according to Chegg Answering Guidelines. Please Re-Post for receiving answers on the other questions.

Answers)
1.)
Answer)
Compare is the attribute that is added for making sure that the two properties on a model object have the same value. This is needed for forcing the customers for example for checking if they made an error in inserting.

2.)
Answer)
The above annotation means that the:
c. FirstName can be of length between 10 and 120 character s

[StringLength (120, MinimumLength=10)] sets the Firstname to a minimum of 10 characters and a maximum of 120 characters.

3.)
Answer)
The Custom Validation attribute can be added by deriving from the base class:
b. ValidationAttribute

Thus any class which needs to form the Custom Validation attribute can inherit the ValidationAttribute.

4.)
Answer)
The advantage of ApplyFormatInEditMode=false is:
b. avoid parsing value formatted for display, which can lead to errors

ApplyFormatInEditMode=false when the formatting string is not applied on the field value in the edit mode. Thus this is done to avoid errors.

**Please Hit Like if you appreciate my answer. For further doubts on the question or answer please drop a comment, I'll be happy to help. Thanks for posting.**

Add a comment
Know the answer?
Add Answer to:
DUE TODAY: Need Help with my ASP NET quiz 1.) [________________] attribute is added to ensure...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C++ implement and use the methods for a class called Seller that represents information about a...

    C++ implement and use the methods for a class called Seller that represents information about a salesperson. The Seller class Use the following class definition: class Seller { public: Seller(); Seller( const char [], const char[], const char [], double ); void print(); void setFirstName( const char [] ); void setLastName( const char [] ); void setID( const char [] ); void setSalesTotal( double ); double getSalesTotal(); private: char firstName[20]; char lastName[30]; char ID[7]; double salesTotal; }; Data Members The...

  • Hello, I need to implement these small things in my C++ code. Thanks. 1- 10 characters...

    Hello, I need to implement these small things in my C++ code. Thanks. 1- 10 characters student first name, 10 characters middle name, 20 characters last name, 9 characters student ID, 3 characters age, in years (3 digits) 2- Open the input file. Check for successful open. If the open failed, display an error message and return with value 1. 3- Use a pointer array to manage all the created student variables.Assume that there will not be more than 99...

  • the language i wan used in C# is visual basic.Create a console program that contains the...

    the language i wan used in C# is visual basic.Create a console program that contains the following ·         A Class named Account with the following properties: o   public int Id { get; set; } o   public string Firstname { get; set; } o   public string Lastname { get; set; } o   public double Balance { get; set; } o   public DateTime CreationDate { get; set; } o   Create a constructor that initializes all of the properties. o   Create a ToString...

  • Here is the UML for the class Contact -fullName : string -phoneNum: string -emailAddress : string...

    Here is the UML for the class Contact -fullName : string -phoneNum: string -emailAddress : string +Contact()                     //default constructor sets all attribute strings to “unknown”; no other constructor +setName(string name) : void +setPhone(string pn) : void +setEmail(string em) : void +getName() : string +getPhone() : string +getEmail() : string +printContact() : void         //print out the name, phone numbers and email address Create New Project Name your project: CIS247_Lab7_YourLastName. For this exercise, you may use a header file or one file...

  • I need to get this two last parts of my project done by tonight. If you...

    I need to get this two last parts of my project done by tonight. If you see something wrong with the current code feel free to fix it. Thank you! Project 3 Description In this project, use project 1 and 2 as a starting point and complete the following tasks. Create a C++ project for a daycare. In this project, create a class called child which is defined as follows: private members: string First name string Last name integer Child...

  • By editing the code below to include composition, enums, toString; must do the following: Prompt the...

    By editing the code below to include composition, enums, toString; must do the following: Prompt the user to enter their birth date and hire date (see Fig. 8.7, 8.8 and 8.9 examples) in addition to the previous user input Create a new class that validates the dates that are input (can copy date class from the book) Incorporate composition into your class with these dates Use enums to identify the employee status as fulltime (40 or more hours worked for...

  • Lab 4: Databased Admin Tool Continued Python Objective: In the previous lab, you developed an admin tool for username an...

    Lab 4: Databased Admin Tool Continued Python Objective: In the previous lab, you developed an admin tool for username and password management. You accomplished the tasks with Dictionary or List. Here, use class to design your own data structure to accomplish a similar task. The UD.txt datafile: FIRST NAME, LAST NAME,USERNAME,PASSWORD Sam, DDal,sdd233,Pad231 Dave, Dcon,dcf987, BHYW4fw Dell, Grant,dgr803,Sb83d2d Mike, Kress,mkr212,UNNHS322 Lisa,Kate,lki065,dgw6234 Paul,Edward,ped332,9891ds Youyou,Tranten,ytr876,dsid21kk Nomi,Mhanken,nmh223,3282jd3d2 Write a program that imports the database from UD.txt, your program can search for users’ password....

  • I need the following written in Java please, thank you ' We want you to implement...

    I need the following written in Java please, thank you ' We want you to implement a java class that will show details on users and throw exceptions where needed. The following requirements specify what fields you are expected to implement in your User class: - A private String firstName that specifies the first name of the user - A private String lastName that specifies the last name of the user - A private int age that specifies user's age...

  • \\ this is the code i need help to get this part working the rest works...

    \\ this is the code i need help to get this part working the rest works but this and im not sure what is missing or how to make it work. this is what they asking for to do and there is two errors the ones shown in the pictures this is all the information I have from zybooks\\ Q3. (54 Points) Complete a public class to represent a Movie as described below. (a-e 4 pts each) (f-h 8 pts...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT