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

[Solved] Nested RadAjaxPanel - problem with validators

1 Answer 261 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Rafael
Top achievements
Rank 1
Rafael asked on 17 Apr 2009, 05:15 PM
Hi developers,

I have a very strange problem with RadAjaxPanel. My webform has a RadAjaxPanel covering the page. Inside this, I have a MultiView with two views. In the second view, I have another RadAjaxPanel. Inside this, I have a form with some fields e some validators. The problem is that my validators is not working. When I try submit the form, the post happens.

I'm using the Telerik 2008 Q3.

Bellow, follows my situation:

 

 

 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePartialRendering="true">  
    </telerik:RadScriptManager> 
 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"   
        HorizontalAlign="NotSet"  > 
        <asp:MultiView ID="MultiView1" runat="server">  
            <asp:View runat="server" ID="mv1">  
                <asp:Button ID="btnChangeView" runat="server" Text="Change view"   
                    onclick="btnChangeView_Click" /> 
            </asp:View> 
            <asp:View runat="server" ID="mv2">  
                <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server"   
                    HorizontalAlign="NotSet"  > 
                    <asp:TextBox runat="server" ID="TextBox1"></asp:TextBox> 
                    <asp:RequiredFieldValidator runat="server" ID="RequeridFieldValidator1" ControlToValidate="TextBox1">*</asp:RequiredFieldValidator>                  
                    <asp:Button runat="server" ID="btnSubmit" Text="Submit"   
                        onclick="btnSubmit_Click" /> 
                </telerik:RadAjaxPanel>   
            </asp:View> 
        </asp:MultiView> 
    </telerik:RadAjaxPanel> 

    protected void Page_Load(object sender, EventArgs e)  
    {  
        if (!IsPostBack)  
            MultiView1.SetActiveView(mv1);  
    }  
    protected void btnChangeView_Click(object sender, EventArgs e)  
    {  
        MultiView1.SetActiveView(mv2);  
    }  
    protected void btnSubmit_Click(object sender, EventArgs e)  
    {  
        TextBox1.Text = "the button is clicked";  
    } 

1 Answer, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 21 Apr 2009, 02:42 PM
Hello Rafael,

Generally speaking, having nested AjaxPanels is not a supported scenario and is not advised unless there is specific reason for it. Having only the outer AjaxPanel should ensure that all controls inside it execute ajax callbacks. I have tested your scenario with this approach and it works as expected on my end. Try it and let me know if that suggestion is applicable for you.

All the best,
Pavel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
Rafael
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Share this question
or