2

I am currently looking a valiadation controls in javascript and ASP.NET and have come across the new MVC "jquery.validate.unobtrusive.js" which appears to use the data tags in the HTML to do the validation, is it possible to use these in standard ASP.NET (none MVC) as my logic seems to indication you can (by adding the appropriate data tags) but I can't find any referrance to using the library outside MVC

Any does anybody know where i can get the libraries !!!

    3 Answers 3

    5

    You won't be able to use the data annotations to govern your validation, but you can use jQuery Validation (which is what MVC3 is using under the covers) for client validation in a web forms app. David Ward has a few good blog posts here http://encosia.com/2009/11/04/using-jquery-validation-with-asp-net-webforms/.

      1

      It wont work quite the same as MVC but take a look here for the validation plugin. It shows you how to implement it and demos.

        0

        Thanks people ... after a little looking about, it appears that the MVV unobtrusive controls, just dont place javascript in the page, but data- attributed to all the controls (and a second control) and then run through witha bit of jQuery, it isnt really what I was looking for, neight does it makes the page any smaller ... thanks for your answers

          Start asking to get answers

          Find the answer to your question by asking.

          Ask question

          Explore related questions

          See similar questions with these tags.