Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyViewModel
- {
- [Required(ErrorMessageResourceType = typeof(Global), ErrorMessageResourceName = "Required")]
- public string Code { get; set; }
- }
- public ActionResult Create()
- {
- var model = new MyViewModel();
- if(something){
- model.SomeThingToRemoveTheRequiredFromCode();
- }
- return View(model);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement