开发者

nested RadAjaxPanel Telerik do not update

I create a RadAjaxPanel with some of inside controls.one of inside control is a nested radajax with a TextBox and a button.both of radajaxpanel update mode are always(in code behind). when i click on button in nested radajax parent radajax will be update an nested radajax will be hide!!Why? I test this scenario with updatepanel and worked correct...

Markup:

<teleri开发者_C百科k:RadAjaxPanel ID="RadAjaxPanel1" runat="server" 
            onajaxsettingcreated="RadAjaxPanel1_AjaxSettingCreated1">

            <asp:TextBox runat="server" ID="txt2" />
            <asp:Button  Text="but1" ID="but"  runat="server" onclick="but_Click" />

        <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" Height="200px" 
                Width="300px" onajaxsettingcreated="RadAjaxPanel2_AjaxSettingCreated">
            <asp:TextBox runat="server" ID="txt" />
            <asp:Button Text="but2" ID="but2" runat="server" onclick="but2_Click" />
        </telerik:RadAjaxPanel>

        </telerik:RadAjaxPanel>    

Code Behind:

protected void but_Click(object sender, EventArgs e)
        {
            txt.Text = "ok";
            txt2.Text = "ok";
        }

        protected void but2_Click(object sender, EventArgs e)
        {
            txt.Text = "ok";
            txt2.Text = "ok";
        }

        protected void RadAjaxPanel1_AjaxSettingCreated1(object sender, Telerik.Web.UI.AjaxSettingCreatedEventArgs e)
        {
            e.UpdatePanel.UpdateMode = UpdatePanelUpdateMode.Always;
        }
        protected void RadAjaxPanel2_AjaxSettingCreated(object sender, Telerik.Web.UI.AjaxSettingCreatedEventArgs e)
        {
            e.UpdatePanel.UpdateMode = UpdatePanelUpdateMode.Always;
        }


You don't need to have a RadAjaxPanel nested inside of another RadAjaxPanel. I can't see anything in your code that warrants it either, so the easiest solution would be to remove it.

If you want to have more control over which controls are AJAX driven, I would suggest using the RadAjaxManager instead:

<telerik:RadAjaxManager ID="AjaxManager" runat="server" UpdatePanelsRenderMode="Inline">    
    <AjaxSettings>                    
        <telerik:AjaxSetting AjaxControlID="MyControl">                
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="MyOtherControl" />
            </UpdatedControls>          
        </telerik:AjaxSetting>
    </AjaxSettings>    
</telerik:RadAjaxManager>  

It looks like the second RadAjaxPanel is just setting a fixed width. Just use a regular Panel or a DIV for this and you should be all set.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜