locked
Validation controls in ASP.Net not working on client side with AJAX toolkit controls RRS feed

  • Question

  • I have an ASP.NET 4.5 project with a web form that has both validation controls (Regular Expression) and AJAX controls (Calendar Extender). The validation controls were not working at all, client side or server side. After some research, I decided that I needed to turn off 'unobtrusive' validation in the web.config by setting the ValidationSettings:UnobtusiveValidationMode to None.  This had no effect. So I decided to set up 'unobtrusive' validation by changing the ValidationSettings:UnobtusiveValidationMode to WebForms in the web.config and adding the code to the Gobal.asax to point the script manager at jQuery 2.0.3. Now the validation controls are working when the form is submitted but not on the client side. I know this is a problem when both AJAX and validator controls are used on the same page, because when I remove the AJAX controls, the validation controls begin working again on the client side.

    I should also point out that I am developing in VS 2012 and when I run the application and go to the page in question, javascript errors are shown in the Output window of Visual Studio.  Don't know if this is the cause of the problem but here are the errors:

    Exception was thrown at line 3568, column 4 in http://localhost:54920/ScriptResource.axd?d=HvFnVq9cnyKUdhtX4DynWBBaD8qwlOChQjIXbApaK3YyI3TVJwqvuHuC0wb92kuvayB6WDLp7paezBorPilycROO_rQycjvwFOTc6EJYTMJ4MHF4ITwVWJNfL_nrUOwnR3wnvJpeXBZ1l1Y6FrmINw2&t=135ac0e7

    0x800a139e - JavaScript runtime error: SyntaxError

    Exception was thrown at line 3582, column 4 in http://localhost:54920/ScriptResource.axd?d=HvFnVq9cnyKUdhtX4DynWBBaD8qwlOChQjIXbApaK3YyI3TVJwqvuHuC0wb92kuvayB6WDLp7paezBorPilycROO_rQycjvwFOTc6EJYTMJ4MHF4ITwVWJNfL_nrUOwnR3wnvJpeXBZ1l1Y6FrmINw2&t=135ac0e7

    0x800a139e - JavaScript runtime error: SyntaxError

    Please let me know what I need to do to get validation controls working properly in ASP.Net 4.5 with AJAX controls.

    Thanks

      

       
    • Moved by Carl Cai Monday, January 20, 2014 8:58 AM (from vb) asp.net forum is more dedicated for these issues
    Friday, January 17, 2014 4:06 PM

Answers

  • Hi,

    For help with Asp.Net projects, please visit http://forums.asp.net

    These forums are aimed more at desktop development and the folks over at asp.net will be able to help you better.


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    • Proposed as answer by Carl Cai Monday, January 20, 2014 8:58 AM
    • Marked as answer by Just Karl Sunday, January 26, 2014 2:03 AM
    Friday, January 17, 2014 4:13 PM