Trigger a asp.net event from a control placed outside the update panel

社会主义新天地 提交于 2019-12-11 19:37:59

问题


I have a very trick situation . i have some check boxes which used as filter for a repeater, and the check boxes are placed inside a jquery accordion , problem arises when i use a ajx update panel the jquery accordion stop working. i want the filtering to be done through async postback. so what i have done is i have placed the repeater inside the update panel. now i want to use the postback option of checkboxes which are placed outside of the update panel to trigger there respective events and update the repeater. How can that be possible. please help.


回答1:


You can define the trigger for Your Update Panel like below to update repeater on checkbox check change.

 <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
.....
</ContentTemplate>
     <Triggers>
    <asp:ASyncPostBackTrigger ControlID="CheckBoxId" EventName="CheckedChanged"/>
      </Triggers>
<<asp:UpdatePanel>

After Define the trigger define checkbox CheckedChanged event and bind your repeater on that event.



来源:https://stackoverflow.com/questions/17876779/trigger-a-asp-net-event-from-a-control-placed-outside-the-update-panel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!