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
  • Write in C++ 1. Use the following Person class (Person.cpp, Person.h). You will be writing Person...

    Write in C++ 1. Use the following Person class (Person.cpp, Person.h). You will be writing Person objects to a random access file. --------------------- Person.cpp--------------------------------- // Class Person stores customer's credit information. #include <string> #include "Person.h" using namespace std; // default Person constructor Person::Person( int idValue, string lastNameValue, string firstNameValue, int AgeValue ) { setID( idValue ); setLastName( lastNameValue ); setFirstName( firstNameValue ); setAge( AgeValue ); } // end Person constructor // get id value int Person::getID() const { return id;...

  • Assignment 4 Java You are required, but not limited, to turn in the following source files:...

    Assignment 4 Java You are required, but not limited, to turn in the following source files: Assignment4.java Club.java President.java New Skills to be Applied In addition to what has been covered in previous assignments, the use of the following items, discussed in class, will probably be needed: Classes Instance Objects Accessors/Mutators(Modifiers) methods Visibility Modifiers (Access specifier) - public, private, etc. Encapsulation concept Aggregation relationship between classes Program Description The following is the description of Assignment4 class. The driver program will...

  • 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...

  • Using Python: Par 1. You will define Student class with the following attributes: CWID: the student’s...

    Using Python: Par 1. You will define Student class with the following attributes: CWID: the student’s CWID FirstName: the student’s first name LastName: the student’s last name Gender: the student’s gender (‘M’ or ‘F’) BirthDate: the student’s date of birth (e.g. ‘03/14/1999’) ClassID: the class id that the student took ClassDate: the date when the student took the class (e.g. ‘01/26/2018’) Grade: the student’s grade for the class In addition, you will do the following tasks: Implement a set of...

  • 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...

  • \\ 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