Validators won't fire - using demo provided

4 posts, 0 answers
  1. Blair
    Blair avatar
    16 posts
    Member since:
    Jul 2013

    Posted 23 Jul 2013 Link to this post

    Using the demo located here:
    http://demos.telerik.com/aspnet-ajax/input/examples/common/validation/defaultvb.aspx

    The validators are allowing a post back with EnableClientScript = true, despite displaying that there is an error case.

    Steps to reproduce:

    1) New web form application
    2) New web form
    3) Copy code into aspx and codebehind
    4) Add a radscriptmanager, removing the masterpage reference [which i cannot find a copy of], and removing the asp:content panels
    5) Override OnLoad and insert a breakpoint
    6) Run the form with client mode on, breakpoint is hit despite all the validators triggering.
    7) Repeat tests in all browsers - all fail.
    What am I doing wrong?

    Update for clarification:
    The validators fire, but they still cause a postback (is this intentional?) and server side they do not flag Page.IsValid as true or false.
  2. Blair
    Blair avatar
    16 posts
    Member since:
    Jul 2013

    Posted 23 Jul 2013 Link to this post

    It turned out to be a web.config setting:

    <httpRuntime targetFramework="4.5"/>

    This setting turns off Javascript injection of validation (client side) and enables (but doesn't turn on) html5 injection of validation (client side).  Google unobtrusive validation for details on the new 4.5 methods.

    Removing this key from my application fixed the problem.  

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jugoslav
    Jugoslav avatar
    64 posts
    Member since:
    Mar 2011

    Posted 23 Jul 2013 Link to this post

    Wow man! How you figured it out? I was hitting my head against the wall trying to figure out a solution ... God bless you Blair!!!
  5. Blair
    Blair avatar
    16 posts
    Member since:
    Jul 2013

    Posted 30 Jul 2013 Link to this post

    I built a working solution from a demo I found online that had just the elements required to make it work.  Then I added in the telerik components and proved it worked.  Then I took the web.config from the working solution and plopped it into my broken solution - it worked.  

    From there it was line by line removal and test.
Back to Top