0

嗨,我想知道是否有人可以帮助我。我想创建一个允许显示和搜索记录的 Ajax 系统。目前,我将函数名称和值传递给名为 userUpdate.aspx 的文件,以带回数据。我的问题是我想添加额外的功能,比如自动完成。我查看了示例,它们都使用 Web 方法和服务。我应该将我的 Ajax 调用移动到 web 方法而不是 aspx 文件,这会带来什么好处?

4

1 回答 1

1

Should I move my Ajax calls to web methods instead of an aspx file and what advantages will this bring?

Certainly moving some methods to a Web Service or exposing them as Page Methods will allow you to make Ajax requests easily with jQuery, for example. If you go the MS Ajax route, you'll have to use Update Panels and Script Managers which are inefficient and will never perform as good as a regular Ajax request that does not trigger the full page life-cycle. As a result, your requests are lighter, faster and slimmer (they carry less data).

于 2012-05-13T23:16:20.800 回答