Duplicate ASP.NET validation messages

3 posts, 0 answers
  1. David Rhodes
    David Rhodes avatar
    60 posts
    Member since:
    May 2005

    Posted 13 Aug 2013 Link to this post


    I have a form which contains a few TextBoxes with RequiredFieldValidators and serveral UserControls each containing RadGrid's, inside each UserControl I am using the following to ajaxify

    <telerik:RadAjaxManagerProxy runat="server">
            <telerik:AjaxSetting AjaxControlID="Grid">
                    <telerik:AjaxUpdatedControl ControlID="Grid" LoadingPanelID="LoadingPanel" />
    <telerik:RadAjaxLoadingPanel ID="LoadingPanel" runat="server" />

    The problem is, everytime I do a postback in any of the RadGrid's, the RequiredFieldValidator messages are duplicated.

    I've read elsewhere that I need to add the ValidationSummary as an UpdatedControl to what is causing the problem but this does not work in this case as the ValidationSummary is in the page, the Grid is in a UserControl

    Any ideas?
  2. David Rhodes
    David Rhodes avatar
    60 posts
    Member since:
    May 2005

    Posted 13 Aug 2013 Link to this post

    I've also tried passing a reference to the ValidationSummary into the UserControl so I can add it like this

    protected override void OnPreRender(EventArgs e)
        RadAjaxManager ajax = RadAjaxManager.GetCurrent(Page);
        ajax.AjaxSettings.AddAjaxSetting(Grid, Grid, LoadingPanel);
        ajax.AjaxSettings.AddAjaxSetting(Grid, this.SubscriptionValidationSummary, LoadingPanel);

    This still causes duplicate error messages

    Also, I have other Ajaxified controls on the Page which don't cause this issue, eg a DatePicker which updates another DatePicker, only the Grids seem to cause this issue
  3. DevCraft R3 2016 release webinar banner
  4. Angel Petrov
    Angel Petrov avatar
    1002 posts

    Posted 16 Aug 2013 Link to this post

    Hi David,

    The PreRender event is fired too late for creating the AJAX setting programmatically. Please try moving the logic in the PageLoad event like demonstrated in this help article. If the problem still persists please share with us the markup and code-behind so we could get a better understanding of the scenario.

    Angel Petrov
    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 the blog feed now.
Back to Top