RadAjaxManager.ajaxRequest cause duplicate error message in ValidationSummary

5 posts, 0 answers
  1. dexter
    dexter avatar
    31 posts
    Member since:
    Jul 2011

    Posted 20 Mar 2012 Link to this post


    Below describes my page:
    A ValidationSummary control at the top of my page.
    A RadComboBox with a RadTreeView as the ItemTemplate.
    A password textbox with a RequiredFieldValidator to validate this textbox(validation group = save )
    An input type='file' control
    A RadToolBar with submit button with validation group = save

    Because the RadTreeView will cause a full postback(which will clear the file control), i'm setting the OnClientNodeClicking event to raise the ajax Request.
    This works fine(file control will not be cleared) but there is a problem with this. Whenever i select a node in the TreeView and the password textbox is empty, the error messages is appended to the validation summary control rather than overweriting it.

    This reproduces the problem:

    1) Leave the password textbox empty
    2) Select the tree view node(3 times)
    3) While the password textbox is still empty, click on the submit
    4) You will see the error messages showing three times. If step 2 is repeated 10 times, then the message will have 10 duplicates.

    Why is this happening?

    I hope someone can help.

  2. Tsvetina
    Tsvetina avatar
    2481 posts

    Posted 23 Mar 2012 Link to this post

    Hello Dexter,

    Can you confirm that you have a setting where the RadAjaxManager on the page updates the ValidationSummary? If not, add it and see if it helps. In case the issue persists, please share code that we can use to reproduce the erroneous behavior.

    Kind regards,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. dexter
    dexter avatar
    31 posts
    Member since:
    Jul 2011

    Posted 23 Mar 2012 Link to this post

    Hi Tsvetina,

    I'm not sure if this is the right way to solve this, but this is what i did. I just want to share to those thats having the same problem.
    I use custom validator instead of RequiredFieldValidator to check the problem and use CliendValidateFunction to explicitly call a javascript function. In that function, i will set the args.IsValid property.

    The most important thing however, is this part:

    function PageLoad(){    




    (Page_IsValid === false)//I can only call it here. Anywhere else wouldn't work because i'm


    {                          //trying to overwrite the duplicate error message
        $('#vs').text("error message");


    }//vs is the validation summary's ID


  4. Spiros
    Spiros avatar
    15 posts
    Member since:
    May 2010

    Posted 15 Jul 2014 Link to this post

    Hi Guys..
    We have a similar problem using telerik RadAjaxManagerProxy and Validation Summary.
    The RadAjaxManagerProxy updates the validation Summary but the errors remains duplicated ..
    Any Idea ?
    Thanks in advance
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 15 Jul 2014 in reply to Spiros Link to this post

    Hi Spiros,

    Please have a look into the sample code snippet which works fine at my end.

    <telerik:RadTextBox ID="rtxtPassword" runat="server" TextMode="Password">
    <asp:RequiredFieldValidator ID="valPassword" runat="server" ErrorMessage="Password is mandatory!"
        ControlToValidate="rtxtPassword" Display="None" ValidationGroup="MyInquiryForm">*</asp:RequiredFieldValidator>
    <asp:ValidationSummary ID="ContactValidationSummary" runat="server" ShowSummary="true"
        ShowMessageBox="false" HeaderText="Please notice that:" ValidationGroup="MyInquiryForm"
        DisplayMode="BulletList" />
    <telerik:RadTreeView ID="rtreeviewDemo" runat="server" MultipleSelect="true">
            <telerik:RadTreeNode Text="Node1">
            <telerik:RadTreeNode Text="Node2">
            <telerik:RadTreeNode Text="Node3">
    <telerik:RadButton ID="rbtnSubmit" runat="server" Text="Submit" CausesValidation="true"
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
            <telerik:AjaxSetting AjaxControlID="rtreeviewDemo">
                    <telerik:AjaxUpdatedControl ControlID="rtreeviewDemo" />

    Please provide a sample code if it doesn't help.
Back to Top