网格视图和Updatepanel问题 [英] GridView & Updatepanel Problem

查看:76
本文介绍了网格视图和Updatepanel问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我使用datatable将数据绑定到GridView.GridView在UpdatePanel内部
我正在使用< asp:buttonfield>在GridView中.
当单击按钮时,将DataTable的值分配给GridView& amp;以外的文本框.都更新面板.

但是问题在于文本框中没有出现值.这些文本框位于另一个更新面板中.

请告诉我解决方法.
提前表示感谢.

Hello there
I binging data to gridview using datatable.GridView is inside UpdatePanel
I am using <asp:buttonfield> inside GridView.
When clicked on button, values of DataTable are assigned to text boxes which are out side the GridView & Update Panel both.

But problem is that values are not comming in the text boxes. These text boxes are in another update panel.

Please tell me solution.
Tthanks in advance.

推荐答案

特定的更新"面板部分刷新了UI,即该更新面板内部的部分.

更新面板可以具有称为触发器"的内容.

根据您的需求:
如果您需要更新UI中的文本框值,则需要触发具有这些文本框值的更新面板进行更新.

您可以使用那些作为触发器添加到第二个更新"面板的按钮字段.然后,每当使用这些按钮字段时,它将触发另一个更新面板,从而更新文本框值.
A particular Update panels refeshes the UI partially i.e. the part that is inside that update panel.

Update panels can have has something called ''Triggers'' associated with them.

From what you need:
if you need to update the textbox values in UI then the update panel having those textbox values need to be triggered for an update.

You can use those button fields added as triggers to the second Update panel. Then, whenever those button fields are used, it will trigger the other update panel and thus update the textbox values.


一个页面可以承载多个UpdatePanel.默认情况下,当页面上的一个UpdatePanel更新时,页面上的其他UpdatePanels也将更新.有时候,这就是您想要的,但通常,您不需要每次更新都可以响应其他UpdatePanels.

您可以通过将页面上每个UpdatePanel控件的UpdateMode属性设置为"Conditional"来选择更新哪些UpdatePanel实例(以及何时更新).然后,当一个UpdatePanel更新并调用服务器端事件处理程序时,在要更新的其他面板上调用UpdatePanel.Update.通过减少呈现的控件的数量,这减少了服务器上的负载,并减少了响应中的数据量,因为不更新的UpdatePanel不会对响应添加任何内容.
A page can host several UpdatePanels. By default, when one UpdatePanel on a page updates, the other UpdatePanels on the page also update. Sometimes that’s what you want, but more often than not, you don’t need every UpdatePanel updating in response to other UpdatePanels.

You can be selective about which UpdatePanel instances update (and when) by setting the UpdateMode property of each UpdatePanel control on the page to "Conditional." Then, when one UpdatePanel updates and calls a server-side event handler, call UpdatePanel.Update on the other panels you want to update. This reduces the load on the server by reducing the number of controls that render, and it reduces the volume of data in the response because UpdatePanels that don’t update don’t add anything to the response.


我遇到了类似的问题.
将文本框放在UpdatePanel中将为您工作.
但是我不确定它是否是正确的解决方案.只是对我有用的一项工作.

我期待收到其他人的反馈,以寻求更好的解决方案..:)
I had a similar problem.
Putting textboxes inside the UpdatePanel will work for you.
But I am not sure if its a correct solution. It''s just a work around that worked for me.

I am looking forward to hear from other people for a better solution.. :)


这篇关于网格视图和Updatepanel问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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