什么是检索表数据的最佳策略是什么?客户端AJAX /服务器 [英] what is the best strategy to retrieve form data? client ajax / server

查看:102
本文介绍了什么是检索表数据的最佳策略是什么?客户端AJAX /服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我被介绍给Ajax表单数据的处理,包括使用jTemplates,以保证一定的重复性和jQuery,一个伟大的图书馆。

Recently I was introduced to Ajax form data handling, including the use of jTemplates to guarantee some repeatability and jQuery, a great library.

不过,我有点糊涂了。随着形式的用户交互,我使用Ajax调用和处理纯HTML标记。因此,如果我要绑定在加载表格形式的数据,我需要做的,与阿贾克斯的jQuery / JS的方式。这似乎并不对我好。 我觉得的onLoad初始化应该只发生在服务器上的。不过后来我需要找到一些方法来揭露的形式标记以便以后Ajax交互将是直接的。

But I'm a little confused. With the form-user interaction, I use Ajax calls and deal with pure HTML markup. So if I want to bind form data on loading of the form, I need to do that with the Ajax by way of jQuery/JS. This doesn't seem good to me. I feel that onLoad initializing should only occur on the server. However then I need to find some way to expose the form markup so that later Ajax interactions will be straightforward.

例如,如果我要绑定的服务器上的一些列表,能够处理的控制这种的方式,这样我以后可以使用Ajax添加/删除项目?

我希望我做了我的观点明确。感谢您的帮助!

I hope that I made my point clear. Thanks for the help!

推荐答案

为您实现最简单的方法是使用更新面板。

The easiest way for you to achieve this is to use an Update Panel.

如果你把你的转发器的更新面板内,当你删除回传被激发,更新面板将只刷新什么都是更新面板内。

If you put your repeater inside an update panel, when your delete post back is fired, the update panel will only refresh what ever is inside that Update Panel.

因此​​,使用中继器构造你行,添加删除按钮,然后删除该行从数据库中。

So, construct your row using your repeater, add the delete button which then deletes that row from the database.

如果你得到它的工作没有Ajax(整个页面回传),然后添加更新面板,它应该的工作开箱的。

If you get it working without ajax (whole page post back) and then add the Update Panel, it "should" work straight out of the box.

看看 http://www.asp.net/ AJAX /文档/现场/教程/ CreatingPageUpdatePanel.aspx 一个例子。

问候

加文

这篇关于什么是检索表数据的最佳策略是什么?客户端AJAX /服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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