What is the meaning of [required]?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Ankit SharmaRank #141 · 16.1K reputationPosted Oct 5, 2017, 11:47 PM EDT
Vighnesh Gadekar56 reputationPosted Oct 30, 2017, 2:57 AM EDT
“using System.ComponentModel.DataAnnotations;” this namespace needs to be added to use [Required].
The required is used to check validations of the variable properties user can also provied custom error message using required.
Eg: [Required(ErrorMessage="Email address Required.")]
Hope this will help.