ValidationSummary and RadAjaxManager

2 posts, 0 answers
  1. John
    John avatar
    22 posts
    Member since:
    Apr 2012

    Posted 21 May 2014 Link to this post

    I have a number of Ajaxified controls and panels using the RadAjaxManagerProxy. Everything works fine, except the following scenario: I have a panel (UpdatedControl) that shows or hides based on a radio button (AjaxControlID). I have another panel that shows or hides based on a dropdown list. The radio button controlled panel has a number of fields with validators attached. If the panel controlled from the radio button is shown, for every dropdownlist ajax call on the screen, all validation messages inside the radio button controlled panel will repeat. I've read that taking the validators outside the Ajaxified panel will fix the problem, but this is not feasible as the validation indicators need to appear next to the fields they are validating.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 21 May 2014 in reply to John Link to this post

    Hi John,

    Please have a look into the sample code snippet to achieve your scenario.

    ASPX:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="radiobtnSelectPanel">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlUpdateControl1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="raddroplist">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlUpdateControl2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <asp:RadioButton ID="radiobtnSelectPanel" Text="Select Panel1" runat="server" AutoPostBack="true"
        OnCheckedChanged="radiobtnSelectPanel_CheckedChanged" />
    <asp:Panel ID="pnlUpdateControl1" runat="server" Visible="false">
        <telerik:RadTextBox ID="radtxtInputOne" runat="server" ValidationGroup="Validate">
        </telerik:RadTextBox>
        <asp:RequiredFieldValidator ID="rfvInputOne" runat="server" ErrorMessage="Required"
            ControlToValidate="radtxtInputOne" ValidationGroup="Validate">
        </asp:RequiredFieldValidator>
        <telerik:RadButton ID="radbtnValidate" runat="server" Text="Validate" ValidationGroup="Validate">
        </telerik:RadButton>
    </asp:Panel>
    <telerik:RadDropDownList ID="raddroplist" runat="server" AutoPostBack="true" DefaultMessage="select" OnSelectedIndexChanged="raddroplist_SelectedIndexChanged">
        <Items>
            <telerik:DropDownListItem Text="Select Panel2" />
            <telerik:DropDownListItem Text="TestItem1" />
            <telerik:DropDownListItem Text="TestItem12" />
        </Items>
    </telerik:RadDropDownList>
    <asp:Panel ID="pnlUpdateControl2" runat="server" Visible="false">
        Panel2
    </asp:Panel>

    C#:
    protected void radiobtnSelectPanel_CheckedChanged(object sender, EventArgs e)
    {
        pnlUpdateControl1.Visible = true;
    }
    protected void raddroplist_SelectedIndexChanged(object sender, Telerik.Web.UI.DropDownListEventArgs e)
    {
        pnlUpdateControl2.Visible = true;
    }

    Please provide your code or do modification in the provided code to replicate the issue for further help.

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top