在UpdatePanel中更新数据列表

编程入门 行业动态 更新时间:2024-10-28 09:23:39
本文介绍了在UpdatePanel中更新数据列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在同一页面中有两个updatepanel.一个是数据列表,另一个是模式弹出窗口.在模式弹出窗口中,我有一个保存"按钮,用于更新数据列表的数据.实际上,保存"按钮可以正常工作并且可以更新数据,但是要查看数据列表中的更新数据,我必须进行回发,而我希望保存"按钮发生异步回发,并且在保存"按钮单击后,数据列表可以向我显示更新的数据.

I've two updatepanel in the same page. In one, there is a datalist while in other there is a modal popup. In modal popup I have a Save button that update datalist's data. In effect Save button work correctly and data are updated but to see updated data in datalist I must do a postback while I would that Save button occur an asyncpostback and datalist show me updated data after Save Button' Click.

我是在modalpopup的updatepanel中这样做的:

I do this in updatepanel of modalpopup:

<Triggers> <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" /> </Triggers>

P.S对不起,我的英语!

P.S Sorry for my English!

推荐答案

对要更新的UpdatePanel(包含DataList)执行相同的操作:

Do the same thing for the UpdatePanel you want to update (that contains the DataList):

<Triggers> <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" /> </Triggers>

由于UpdatePanel的子级不会触发回发,因此它不知道刷新,而是明确告知单击 btnSave 时,应该这样做可以解决您的问题.

Since a child of the UpdatePanel isn't triggering the postback, it doesn't know to refresh, telling it explicitly that when btnSave is clicked it should do so should solve your issue.

更多推荐

在UpdatePanel中更新数据列表

本文发布于:2023-11-25 00:17:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627514.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据   列表   UpdatePanel

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!