Will you providing a Validation framework for ASP.NET MVC?

Thread is closed for posting
12 posts, 0 answers
  1. Will Huang
    Will Huang avatar
    10 posts
    Member since:
    Feb 2009

    Posted 03 Feb 2009 Link to this post

    The ASP.NET MVC validation framework are weak.  Are you plan to providing a Validation framework for ASP.NET MVC?
  2. Ivo
    Admin
    Ivo avatar
    689 posts

    Posted 05 Feb 2009 Link to this post

    Hello Will Huang,

    We do not yet have any plans for a Validation framework specifically for ASP.NET MVC but you can use RadInput and RadInputManager to greatly simplify the validation.

    Kind regards,
    Ivo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Wei
    Wei avatar
    33 posts
    Member since:
    Oct 2008

    Posted 10 Feb 2009 Link to this post

    If you want strong validation I recommend Microsoft Enterprise Framework Validation Block.
    http://msdn.microsoft.com/en-us/library/cc467894.aspx

    http://msdn.microsoft.com/en-us/library/dd140088.aspx
  5. John Brahy
    John Brahy avatar
    2 posts
    Member since:
    Apr 2007

    Posted 03 Jun 2009 Link to this post

    You might want to check out MVCContrib as well, including xVal.
  6. GrZeCh
    GrZeCh avatar
    98 posts
    Member since:
    Dec 2007

    Posted 05 Jun 2009 Link to this post

  7. Timothy Fischer
    Timothy Fischer avatar
    10 posts
    Member since:
    Mar 2009

    Posted 10 Jun 2009 Link to this post

    Ran into xVal in my searches and like how it works; however, how does one go about adding the attributes to the model such that they are not overwritten during a regen?

    Am I missing something?

    Even better ->  is it possible to modify the Output from OpenAccess to include necessary attributes for validation?
  8. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 11 Jun 2009 Link to this post

    Hi Timothy Fischer,
    Currently OpenAccess does not posses any means of validation framework, neither it suports such for Asp.net MVC. Could you share with us your expectations what exactly OpenAccess should do to enhance the support of Asp.net MVC validation? Thanks in advance for the feedback.

    Sincerely yours,
    Dimitar Kapitanov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  9. Timothy Fischer
    Timothy Fischer avatar
    10 posts
    Member since:
    Mar 2009

    Posted 11 Jun 2009 Link to this post

    Dimitar,
     As per the xVal.codeplex.com site, we add the validation code to the Model by putting these types of attrbutes on the properties:

     

     


    Here is the example Model:

    public class Booking
    {
        [Required] [StringLength(15)]
        public string ClientName { get; set; }
     
        [Range(1, 20)]
        public int NumberOfGuests { get; set; }
     
        [Required] [DataType(DataType.Date)]
        public DateTime ArrivalDate { get; set; }
    }


    Then the xVal library and jQuery allow for handling the validation based on those attributes. The nice thing about it is that via the xVal library, any validation handlers can be used.


    *BUT*, those attributes somehow need to be added in the Model.

    Perhaps it is possible another way, but I would not know how.

     



    Tim
  10. Dimitar Kapitanov
    Admin
    Dimitar Kapitanov avatar
    632 posts

    Posted 11 Jun 2009 Link to this post

    Hi Timothy Fischer,
    Ok I see your point, though I ‘am unable to give you insight when this will be on our TODO list for OpenAccess. We are definitely considering adding validation logic to the O/R tool.


    Kind regards,
    Dimitar Kapitanov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  11. Mac
    Mac avatar
    36 posts
    Member since:
    Nov 2006

    Posted 04 Aug 2009 Link to this post

    Another +1 for xVal and DataAnnotations. It's nice and clean and 'it just works'

    I've also asked the question about validation in OpenAccess but it seems there are no plans for it yet but there are a couple of current options, one is to use the metadata attribute against your generated partial classes, the other is modifying the OpenAccess templates, more details here - http://www.telerik.com/community/forums/orm/general-discussions/dataannotations.aspx 

    Hope that helps.
    Mac.
  12. Håvard
    Håvard avatar
    11 posts
    Member since:
    Dec 2009

    Posted 28 Sep 2010 Link to this post

    Hi, this thread is kind of old now so I want to ask if theres been any development on this issue?

    Seems its a standard part of mvc2:
    http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx

    I would like to use this with openaccess though.

    (The template solution looked kind of hackish for me so I haven't tried that)

  13. Serge
    Admin
    Serge avatar
    375 posts

    Posted 30 Sep 2010 Link to this post

    Hello Håvard,

     The templates you have seen in this thread refer to the ones use with OpenAccess Classic. If you are using the new designer you should have a look at the T4 templates we use for code generation. You will find this blog post and this help article helpful.

    I would like to point out that the article you have shared actually uses the so called "buddy classes", which is a technique that you can use with any class and allows you to extend the generated classes with additional attributes. This means that you should not experience any problem in using it with OpenAccess, however it will be your responsibility to add the data annotations as we haven't yet planned such a feature.

    I hope this helps and if you experience any trouble please contact us back.

    Kind regards,
    Serge
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017