Please help in the following issue .
The asp.net validator controls (like required field validator, compare validator etc) are firing after the postback (when the submit or rad grid insert button is pressed). This is happening in the case when the RadAjaxPanel is used.
Thanks & Regards,
AbdulRahman
TCS
12 Answers, 1 is accepted
What do you mean by saying that the validation fires after postback? Can you provide sample code for replicating the problem and a description of what happens exactly on your side?
Greetings,
Tsvetina
the Telerik team
Please help in the following issue .
The asp.net Required field validator controls are firing after the postback. But then My combobox doesn't show me any fields in there? This happens when i select a item out of my "towncombobox" that populate my next combobox "Suburbs", so i can select out of Towns but if it do the postback i don't get any items in the Suburb Combobox? can you help me please?
Thanks
Dian Van Eeden
TGIS
I do not fully understand your scenario. What do you mean by that the validators are firing after postback? And also, can you confirm that your comboboxes work when there are no validators? If so, you can consider using ValidationGroups in your page to prevent validation of controls that should not be validated at this point.
If the problem persists, it would be helpful if you post your code, so that we can look for any problems with it.
Greetings,
Tsvetina
the Telerik team
I got it right after i posted the question.
I just set Causes Validation to False and it works .
Thanks alot
Dian
TGIS
hi ,Tsvetina
please help i am also facing same problem
Please provide some more details for the exact scenario you are implementing and for the issue you are currently facing. Thus we can revise your case locally and advise you further.
Regards,
Maria Ilieva
Telerik
Based on these Descriptions, I am encountering the same or related issue using: (Telerik.Web.UI. v. 2015.2.623.45)
In describing my situation let me just out by saying, that my particular set up/UI is a little complex and I believe is contributing to the behavior which I am about to describe:
Set Up: I have 4 Grids That are all using
EditMode="Batch"
<
BatchEditingSettings
EditType
=
"Row"
/>
Each one of the grids is AJAX enabled and they are all affected/controlled by a (Customer) Selector.
Each one of the Grids has One or more validated fields for Update,
ValidationSettings-CommandsToValidate="Insert,Update"
<
ColumnValidationSettings
EnableRequiredFieldValidation
=
"true"
><
br
> <
RequiredFieldValidator
ForeColor
=
"Red"
ErrorMessage="<b>*</
b
>Required" ValidationGroup="vgCustomers" Display="Dynamic"></
RequiredFieldValidator
><
br
> </
ColumnValidationSettings
>
Problem:
Validation works fine when Grids are first rendered (Unfiltered By Ajax selector), However once the Grid is (AJAX) filtered by the selector the validation does not work (looking at the rendered code confirms this the necessary mark up does not exist). Now in addition this only happens the first time around meaning if the edit is submitted (and errors) the validation reappears/works. The problem only exists when the grids reload from an AJAX post-pack initiated by the selector.
This is common to all 4 grid even though they are all set up a little differently. They also all use a _preRender method to do some specific grid customizations.
I can provide more code if necessary but do not want to overwhelm on initial Post.
Can you please share the entire RadGrid markup and related code behind as well as the Ajax settings you have on the page? Also please let me know which version of our controls you are using. Thus we will be able to revise the exact code locally and advise you further.
Regards,
Maria Ilieva
Telerik
Hi Maria,
Thanks for your response. I will appreciate any assistance provided. To that end, as per your request I can provide you with the One or all the Grid Mark up and ajax settings as well as the code behind. Is there an email address I can send this to rather than post it on this forum?
As indicated above I am using Telerik RadControls version 2015 2nd quarter for .net 4.5 (however my Target Framework is: 4.0),
<
httpRuntime
targetFramework
=
"4.0"
/>
Which I set because when I set it to 4.5 it caused JavaScript runtime errors in my .net validators, which, as I write this makes me think that is probably very much related to the issue I am encountering(?)
Thanks in advance, and please let me know how to proceed as far as submitting code, if still necessary?
Try setting the TargetFramework to 4.5 and add the following setting int he applictaion web.config:
<
appSettings
>
<
add
key
=
"ValidationSettings:UnobtrusiveValidationMode"
value
=
"WebForms"
/>
</
appSettings
>
and see how it goes
Regards,
Maria Ilieva
Telerik
Hi Maria,
Thanks for the suggestion. I have been down that road already, and the results are as Indicated above. The ASP.net validators throw Javascript runtime errors. I actually answered a question in Stack dealing with that specific issue.
http://stackoverflow.com/questions/16660900/webforms-unobtrusivevalidationmode-requires-a-scriptresourcemapping-for-jquery/34078463#34078463
I think I may have to convert the Telerik Validaton wrappers to standard ASP.net Validation. I think that the issue is caused by a rendering conflict.
Try converting the Validators and let us know what the result in this case is.
Regards,
Maria Ilieva
Telerik