TabContainer外部的控件不会在存在UpdatePanel的情况下刷新 [英] Controls outside TabContainer doesn't refresh with UpdatePanel present

查看:55
本文介绍了TabContainer外部的控件不会在存在UpdatePanel的情况下刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


当我尝试在TabContainer控件内部使用UpdatePanel时遇到此问题
TabContainer外部完全不刷新.
请帮忙.
谢谢

Hi,
I have this issue when I try to use UpdatePanel inside TabContainer, the controls
outside the TabContainer doesn''t refresh at all.
Please help.
Thanks

<asp:ScriptManager ID="ScriptManager1" runat="server"/>

Test controls outside TabContainer:<br />
Result:  <asp:TextBox ID="txtResult" runat="server"></asp:TextBox>
<br />

<cc1:TabContainer ID="TabContainer1" runat="server" Width="600" ActiveTabIndex="0">
    <cc1:TabPanel ID="TabPanel1" runat="server">
        <HeaderTemplate>Calculate</HeaderTemplate>
                    <ContentTemplate>
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                            <ContentTemplate>
                                <asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="0">
                                    <ProgressTemplate>
                                        <div: style="position:absolute; width:100%;height:100%;">
                                            <img style="position:fixed; bottom:50%; left:50%; z-index: 999999;" src="../Images/ajax-loader.gif" alt="" />
                                        </div:>
                                    </ProgressTemplate>
                                </asp:UpdateProgress>

                                First Value:  <asp:TextBox ID="txtFirstValue" runat="server"></asp:TextBox>
                                <br />
                                Second Value: <asp:TextBox ID="txtSecondValue" runat="server"></asp:TextBox>
                                <br />
                                <asp:Button ID="Button1" runat="server" Text="Button" />

                            </contenttemplate>
                        </asp:UpdatePanel>
                    </ContentTemplate>
    </cc1:TabPanel>
</cc1:TabContainer>



控件txtResult不会刷新,尽管UpdatePanel可以正常工作.



The control txtResult is not refreshed, whithout the UpdatePanel works fine.

Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click
    txtResult.Text = txtFirstValue.Text + txtSecondValue.Text
End Sub

推荐答案

这就是使用UpdatePanel的全部要点. UpdatePanel范围之外的控件不会更新.您可以在后面的代码中访问它们,因为它们是页面设计器和部分类的一部分,但在部分页面刷新的上下文中不可用.

在不使用UpdatePanel时会刷新,因为您要进行整页回发.
That is the whole point of using an UpdatePanel. Controls outside the scope of the UpdatePanel are not updated. You can access them in the code behind because they are part of the page designer and partial class but they are not usable in the context of an partial page refresh.

It refreshes when not using the UpdatePanel because you doing a full page postback.


这篇关于TabContainer外部的控件不会在存在UpdatePanel的情况下刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆