简体   繁体   English

如果不在更新面板中,如何更新userconrol的内容?

[英]How to update the content of a userconrol if is outside the update panel?

I have a user control which is inside a update panel.This user control has a event like 我在更新面板中有一个用户控件。此用户控件有一个类似的事件

protected void ucNote_NoteAdded(object sender, NoteAddedEventArgs noteAddedArgs)
    {}

Inside this i am checking a checkbox which is outside the update panel. 在此内部,我正在检查更新面板之外的复选框。 But it is not checking the checkbox ? 但这不是选中复选框吗? In firebug i found that the html for that checkbox is not rendered. 在萤火虫中,我发现该复选框的html未呈现。 What is the way to do that? 这样做的方式是什么?

Have you tried to add trigger for UpdatePanel which contain checkbox? 您是否尝试为包含复选框的UpdatePanel添加触发器?

           <asp:UpdatePanel runat="server" ID="upnlMy">
                <ContentTemplate>
                     <asp:CheckBox runat="server" ID="chkSomeCheckbox"
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="ucNote" EventName="NoteAdded" />                    
                </Triggers>
            </asp:UpdatePanel>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM