
We currently converting our from ASP.NET UpdatePanels and are wondering if we are missing something simple? If not can we plan on client side validation in RadAjaxManager in the near future?
Thanks,
Chris
36 Answers, 1 is accepted
RadAjax Prometheus is based on MS AJAX so we inherit its strengths and weaknesses. Validators are officially not supported by MS AJAX (http://asp.net/ajax/documentation/live/overview/UpdatePanelOverview.aspx) and therefore not supported by RadAjax Prometheus.
Sincerely yours,
Steve
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

My question is are there any plans to replicate this behavior from the UpdatePanel in the RadAjaxManager or RadUpdatePanel?
If a code example of validators working in the UpdatePanel would be helpful, let me know.
Thanks,
Chris
In my previous reply, I have attached a sample page that works with RadAjaxManager and RadAjaxPanel and validators. Give it a spin and let us know of the outcome.
All the best,
Steve
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

I looked at the example you sent and it seems that the example isn't using the new Prometheus controls set. After more experimentation, I have more information on why client side validators are not working in the RadAjaxPanel but work fine in the UpdatePanel. ASP.NET Validators use the Expando Attribute functionality in the ASP.NET AJAX ScriptManager. When the validator is rendered it registers the attributes with the script manager. When the ScriptManager renders, it writes the expando attributes to the response.
When the ScriptManager is building an async response, it only emits the script for the expando attributes that are children of an UpdatePanel being refreshed. The process it uses is to start at the expando attribute's control and work upwards through the control tree using the control's Parent attribute until it reaches the end or an update panel being refreshed. When using the UpdatePanel this works fine since the update panel contains a reference to it's child tree in it's controls collection.
The RadAjaxManager and RadAjaxPanel seem to use a mechanism where the UpdatePanel is created automatically and it's ContentTemplateContainer contains two controls, one of which contains a field referencing the UpdatePanel's content, but no reference in the controls collection (I assume that the special controls's render method manually calls the contained content's render method). Since the control hierarchy between the validator and the update panel is broken, ASP.NET Ajax never renders any of the expando attributes since a path can't be traced from there to the update panel.
I've tried to move the rendered content to the controls collection of the special control in the AjaxSettingsCreated event and successfully got the ExpandoAttributes returning in the async response, but unfortunately that's caused other problems. Is there a known solution to this problem?
Thanks,
Chris
Sorry for the wrong attachment. I have by mistake attached a page with the old RadAjax before the migration. Find attached the same functionality using the Prometheus RadAjax and let us know if having problems with this.
Regards,
Steve
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

1. Enter valid values into the two text boxes.
2. Cause a posback using the submit button.
3. Change one of the entries to be empty.
4. Try to submit again. This time the validator will fire, but only server side. Once an async postback has occurred, the client side validators won't work.
Up until the async postback occurs the client side validation works perfectly. If you replace the RadAjaxPanel with an UpdatePanel, the client side validators work fine after the async postback.
Thanks,
Chris
Please comment out all the code in the RegisterButton_Click eventhandler and try following your steps again. You will notice that the client-side validation is fired as expected in this case as well.
Sincerely yours,
Steve
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

To see the problem more clearly, download fiddler and watch the network trace of http requests. If you open your page and click register without entering any data you'll see that no http request is generated to the server to validate there is data in the text boxes.
Once you enter valid data and force an async postback this changes. From then on any time you click register with invalid data in the text boxes, a server request is made since the client side data structures aren't initialized property (the missing expando attributes in the async response).
The problem I have is not with what is displayed in Label3 and Label4, my problem is related to a suite of client side script we use that interacts with validators. Currently all of our scripts fail after an async postback due to the missing validator structures, but they work fine using an update panel.
Is there a way we can better connect to get you the information necessary to see the problem?
Thanks,
Chris

Okay, I have read these posts and your validation example (got VB?). I spent a lot of time attempting to move my web app from "old" RadAjax to Prometheus only to find my validation heavy form elements and control events are ALL error prone. I'm glad I found this post in time to save myself but the nagging question haunts me... will I eventually have to recode all my pages to accomodate MSAjax problems not experienced with Telerik Ajax (Pre-Prometheus - AjaxManager)?
Thanks
John
You are right about this problem. We will do our best to provide fix as soon as possible - unfortunately due to the complexity of the dynamic update panels rendering we will need a bit more time to find clear working solution.
Regards,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

Please use following dll in your solution
http://blogs.msdn.com/mattgi/attachment/1516974.ashx
and add following mappings to your web.config
<tagMapping>
<add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="Sample.Web.UI.Compatibility.CompareValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="Sample.Web.UI.Compatibility.CustomValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="Sample.Web.UI.Compatibility.RangeValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Sample.Web.UI.Compatibility.RegularExpressionValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="Sample.Web.UI.Compatibility.RequiredFieldValidator, Validators, Version=1.0.0.0"/>
<add tagType="System.Web.UI.WebControls.ValidationSummary" mappedTagType="Sample.Web.UI.Compatibility.ValidationSummary, Validators, Version=1.0.0.0"/>
</tagMapping>
And enjoy client side validator, hope this will help you

http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx
I came across that entry in my search for a fix to my problem, and simply discarded it due to the the age of the post (Jan 2007) and the mention of it being included in a windows update, and the fact that in my particular scenario outlined in a separate support ticket which forwarded me to this link the standard ASP.NET Ajax panel was working, and it was a problem with Teleriks panel.
I will implement the suggested code and report back.

Just to update this has had no impact on our problem, the client side validation is still not working as desired, and as working when using the standard asp.net ajax panel.
Unfortunatelly you are right - we are still working on this issue and we will do our best to provide fix with Q3.
Regards,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

rob
We are still working on this subject because the problem appears to be more complex than we initially through. Hopefully the fix for the ASP.NET validators will appear in one of the next versions of RadAjax Prometheus. Please excuse us for the temporary inconvenience.
Kind regards,
Stephen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

I will not be re-tooling with Prometheus until a work-around or "fix" addresses the client-side validation concern.
Regards
John

it would be really cool if telerik could keep this thread updated so we all know where are with this. i'm sure this particular item of functionality would be keenly anticipated by many.
cheers,
rob
I am pleased to inform you that we solved the problem with the ASP.NET validators and RadAjax Prometheus and the fix will be available officially for the Q3 2007 SP2 release, scheduled at the end of this month. For testing purposes I am attaching the latest internal trial build of RadControls Prometheus to this forum post. The build should be relatively stable and you can migrate to it until the fix becomes a fact.
If this is something urgent for your development progress, please request a dev version of the hotfix via the support ticketing system. We will gladly provide it for you.
Best regards,
Stephen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

We have just upgraded to the latest Q2 2007 SP2 release and there seems to be progess on this, but it does not seem to completely resolved. I have created a new support ticket with a project attached.
Rob

Thanks!
A sample runnable project replicating the problem you experience will be much appreciated. Please, submit a formal support ticket where you can attach the necessary resources, thank you!
Greetings,
Konstantin Petkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center

What's the latest on this?
The latest version of RadControls for ASP.NET AJAX is 2008.2.1001. Please migrate to this version following the instructions from the KB article linked below and let us know whether the validation works as expected:
http://www.telerik.com/support/kb/article/b454K-kad-b454T-a-b454c-a.aspx
Best regads,
Stephen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

I have been researching this for days and read this thread and it is the most updated info I can find. I installed the latest version actually 1125 and still having a problem. Funny thing is that validation works correctly with RadAjaxUpdatePanel, but still not with RadAjaxManager.
If you have a control in the panel that causes ajax postback and then a control outside that should cause validation and full postback the validation works fine only if there is no RadAjaxManager on the page.
If I add a RadAjaxManager all ajax postbacks cause the validation to not work properly.
I have included the code for my test page. Currently it should bypass client validation on button 3 click after either button 1 or 2 has been clicked. Simply comment out the RadAjaxManager and validation on button 3 works fine after an ajax postback from button 2. Hopefully you can reproduce this from my code.
Is this something that should be working now or is it still not supported?
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="TMPro.WebForm1" %> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head runat="server"> |
<title></title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<asp:ScriptManager ID="ScriptManager1" runat="server"> |
</asp:ScriptManager> |
<div> |
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="Button1" EventName="Click"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
<asp:Button ID="Button1" runat="server" CausesValidation="false" Text="First Button" /> |
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"> |
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" Display="Dynamic" runat="server" ControlToValidate="TextBox2" ErrorMessage="Second text requires value."></asp:RequiredFieldValidator> |
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> |
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> |
<asp:Button ID="Button2" runat="server" CausesValidation="false" Text="Second Button" /> |
</telerik:RadAjaxPanel> |
<asp:Button ID="Button3" runat="server" CausesValidation="true" Text="Third Button" /> |
</div> |
</form> |
</body> |
</html> |
Public Partial Class WebForm1 |
Inherits System.Web.UI.Page |
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load |
End Sub |
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click |
TextBox1.Text = "Button 1 Clicked" |
End Sub |
Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click |
TextBox1.Text = "Button 2 Clicked" |
End Sub |
Private Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click |
TextBox1.Text = "Button 3 Clicked" |
End Sub |
End Class |
Thanks,
Bryan
From your code snippets I see that you specified the RadAjaxPanel as an updated control through the RadAjaxManager settings. Note that you can safely remove the RadAjaxPanel and replace it with standard asp Panel instead since the ajax manager will automatically inject MS UpdatePanel around the updated controls at runtime, namely:
<asp:Panel ID="RadAjaxPanel1" runat="server"> |
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" Display="Dynamic" runat="server" ControlToValidate="TextBox2" ErrorMessage="Second text requires value."></asp:RequiredFieldValidator> |
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> |
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> |
<asp:Button ID="Button2" runat="server" CausesValidation="false" Text="Second Button" /> |
</asp:Panel> |
Thus you will avoid nesting of MS UpdatePanels which is not necessary in this case. Let me know whether the validation works as expected after this modification.
Best regards,
Sebastian
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.

I went through the entire thread and tried out few things. I found that client validators do work even after post back, but there is one limitation. They do work only if submit button(which triggers the validation) is used as AjaxControlID in <AjaxSetting>.
So If I have two submit buttons in one panel then for client validators to work correctly I will have to do two <AjaxSetting> entries, one for each button.
I also observed that I use simple AjaxPanel then all submmit buttons in panel work correctly. But If same panel is specified in list of <UpdatedControls> inside AjaxManager then things start going wrong.
Is this an issue with ajax controls or I am missing something. Please point me to any information related to this.
Regards
Shrikant
All the best,
Pavel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

Thanks for the reply. I understand ajaxifying radajaxpanel with ajax manager is not required and should be avoided.
But my scenario is when I have a simple asp:Panel and there are two submit buttons in it. Now for client validators to work correctly I have to do two entries in ajax manager :
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="button1" >
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="panel"/>
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="button2" >
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="panel"/>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
If I dont do entry for "button2" then client validators on button2 don't work after postback.
Is this a expected behavior or I am missing something?
Regards
Shrikant
Sincerely yours,
Pavel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

Thanks a lot for reply.
I looked at the example. I had to change it for correcting the ID of panel in AJAXManager. I changed the line
<telerik:AjaxUpdatedControl ControlID="Panel" /> |
to
<telerik:AjaxUpdatedControl ControlID="Panel1" /> |
After this change, panel got actuallly ajaxified.
Now here are the steps I follow
1) Do not enter any value in textbox2 and click button2, error will appear page will not be posted. This is as expected.
2) Now enter some value in textbox2 and click button2, page will get posted. This is as expected.
3) Now do not enter any value in textbox2 and click button2, page will get posted ! This is not what I expect.
What I can conclude from this is, validator is not working correctly after postback.
If I follow same steps with button1, then every time textbox2 is blank I get error no matter whether page is already posted.
If I uncomment the lines which have ajaxsettings for button2, then button2 also starts behaving as expected.
Regards
Shrikant
<
telerik:AjaxSetting
AjaxControlID
=
"Button2"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"RequiredFieldValidator1"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
Depending on your needs you should add a setting which includes Button2 to update the validator, as you have found out yourself. I hope this explanation is helpful.
Best wishes,
Pavel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

Thanks for confirming this behavior.
I have one more question. Instead of entering validator as updated control in AjaxManager I am making two entries as follows
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="Button1" > |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="Panel1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
<telerik:AjaxSetting AjaxControlID="Button2" EventName="Click"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="Panel1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
This makes all validators in panel run correctly.
Just wanted to know whether this will create any problem?
Regards
Shrikant
All the best,
Pavel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.

I am using this version - 2008.2.826.35
All the best,
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.