Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi I would want to have validations something of this sort
C#
[RequiredCustom(ActionType=(int)Action.Update, ActionType=(int)Action.Delete)]
public string NotesID { get; set; }

[Required]
[RegularExpression("1|2|3|4")]
public int ActionType { get; set; }

I would want to validate this NotesID only when Updation and Deletion is taking place. I don't need any javascript code for unobtrusive and all. I just want server side validation.

Please don't suggest use of separate models I can't do that. Something similar solution will also do.

Let me know if this requires more clarification, Any help would be greatly appreciated.
Posted
Comments
Richard Deeming 7-Oct-14 8:00am    

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900