I want to restrict user from entering a date except a particular range in my MVC 4 application. Please suggest how can I do this.
-
what have you tried so far? what validation framework are you using? are you validating on the client, server or both?Jason Meckley– Jason Meckley2013-05-03 12:09:46 +00:00Commented May 3, 2013 at 12:09
-
You have to implement self validated class. Use IValidatableObject and take a look here weblogs.asp.net/scottgu/archive/2010/07/27/…NoWar– NoWar2013-05-03 12:10:28 +00:00Commented May 3, 2013 at 12:10
-
This link will be helpful for date range validation stackoverflow.com/questions/13183647/…Nikhil Gaur– Nikhil Gaur2013-05-03 12:15:01 +00:00Commented May 3, 2013 at 12:15
-
@JasonMeckley: I have to implement on both server as well as client. I have implemented server side validation by inheriting my class 'DateRangeAttribute' with 'ValidationAttribute' class and it is working fine. But I need it on client side also. So is there a inbuilt or predefined approach to do this?atul– atul2013-05-03 12:15:37 +00:00Commented May 3, 2013 at 12:15
-
1You should state in your question that you have implemented server-side validation, and that you need to implement client-side validation. Otherwise, people will see the C# tag and automatically think server-side.CM Kanode– CM Kanode2013-05-03 12:30:55 +00:00Commented May 3, 2013 at 12:30
|
Show 2 more comments