开发者

How to trigger UpdatePanel from a GridView TemplateColumn click?

I have the following case, all my controls on an update panel on the page.

One of these controls is a GridView, this GridView contains a CheckBox on t开发者_开发技巧he header template field (to make a check all). The autopostback is true but when the check changed no thing is changed, the update panel has a trigger asynchronous post back for the GridView.


I just fixed this bug after searching everywhere and tried the last solution here with no success. So I first created an OnClick event in the CheckBox. In the Onclick function in the .cs file, make a call to the SelectedIndexChanged(new object(), new EventArgs()); method with arguments as given then just after call the Update method to your UpdatePanel.


You'll have to define an ASyncPostBackTrigger like so:

<asp:UpdatePanel>
 <Triggers>
         <asp:AsyncPostBackTrigger ControlID="yourCheckBox" />
  </Triggers>
<ContentTemplate>
...GridView etc
</ContentTemplate>
</asp:UpdatePanel>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜