This is a migrated thread and some comments may be shown as answers.

Validators won't fire - using demo provided

3 Answers 56 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Blair
Top achievements
Rank 1
Blair asked on 23 Jul 2013, 08:04 PM
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.

3 Answers, 1 is accepted

Sort by
0
Blair
Top achievements
Rank 1
answered on 23 Jul 2013, 09:46 PM
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.  

0
Jugoslav
Top achievements
Rank 1
answered on 23 Jul 2013, 10:25 PM
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!!!
0
Blair
Top achievements
Rank 1
answered on 30 Jul 2013, 07:28 PM
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.
Tags
General Discussions
Asked by
Blair
Top achievements
Rank 1
Answers by
Blair
Top achievements
Rank 1
Jugoslav
Top achievements
Rank 1
Share this question
or