This is a migrated thread and some comments may be shown as answers.

ValidationSummary and RadAjaxManager

1 Answer 75 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 2
John asked on 21 May 2014, 12:42 PM
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.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 May 2014, 04:43 AM
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.
Tags
Ajax
Asked by
John
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Share this question
or