asp.net web表单AJAX更新的GridView [英] asp.net webforms ajax update gridview

查看:260
本文介绍了asp.net web表单AJAX更新的GridView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有相当大量的信息(100S或行和列),这是我们需要改进的preformance。

We have a gridview with quite a large amount of information (100s or rows and columns) which we need to improve preformance of.

目前,以解决一些我们已经取得的GridView控件没有edittemplate,而是双击单元格将弹出的是使用webMethods和人口动态使用jQuery检索到的可用选项的下拉列表中的性能问题,后一个选项choosen在下拉我们在HTML德值设置为所选选项的值。

Currently to fix some performance issues we have made the gridview have no edittemplate and instead double clicking on a cell will bring up a dropdown of the available options that is retrieved using webmethods and populated using jquery dynamically, after an option is choosen in the dropdown we set teh value in the html to the value of the selected option.

我们有问题随后发送此变回服务器,我们有导致回发到服务器的页面上的按钮,但我们通过jQuery的功能所做的更改不可用,当我们遍历gridview的项目,他们仍然有相同的值previous。

We are having problems subsequently sending this changes back to the server, we have a button on the page that causes a postback to the server but the changes that we have made via the jquery functionality aren't available when we loop through the gridview items they still have the same values as previous.

难道对这个错误的方式填充的角度/更新我们如何才能做到这一点?

Are we going about this the wrong way in terms of populating/updating how can we achieve this?

另外:我知道我们也许应该限制在网格的界限,但目前这是不是一种选择

Aside: I know we should probably limit the bounds of the grid but at the moment this is not an option

推荐答案

当您使用GridView控件本身,也就是说,你让它处理编辑模板,的ViewState 进入现场,工作只是精细。但是,当你手动操纵网格,没有变化反映在相关的地方,因此在服务器具有相同的价值观。你说,你通过jQuery获取上双击自动值。你为什么不更新模糊行?我的意思是,当用户进入到下一行,只需更新通过Ajax当前记录。这是最安全的做法。 有一次,我曾与Telerik的RadTree同样的经历。你应该:

When you work with GridView natively, that is, you let it handle the edit template, ViewState gets into the scene and works just fine. But when you manipulate grid manually, no change is reflected in related places, thus having the same values at server. You said that you fetch values on dblclick via jQuery. Why don't you update the row on blur? I mean, when user goes to the next row, simply update the current record via Ajax. That's the most safe approach. Once I had the same experience with Telerik's RadTree. You should:

  1. 为您提供的控件使用客户端API,或者
  2. 请不要乱用原生的方式你的控制工作,同时希望回发的工作,或
  3. 使用控件只是用于显示目的,但对于操作,使用AJAX。

这篇关于asp.net web表单AJAX更新的GridView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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