使用Ajax javascript调用(XMLHTTPREQUEST)Bindind网格视图不起作用. [英] Bindind a grid view with Ajax javascript call (XMLHTTPREQUEST) does not work.

查看:73
本文介绍了使用Ajax javascript调用(XMLHTTPREQUEST)Bindind网格视图不起作用.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用滚动条从左到右显示一些记录.

但我在切换到网格视图" 上方有一个按钮,我想在单击此按钮时以网格视图显示记录.

我正在使用 XMLHTTPREQUEST .

当我单击按钮并使用 XMLHTTPREQUEST 将数据源分配给服务器端功能中的网格视图时.它不起作用..

这个问题有什么解决办法吗?


谢谢.

i am showing some records in a left to right position with a scroll.

but i have button above "Switch to grid view" and i want to show the records in a grid view on clicking this button.

i am using XMLHTTPREQUEST.

when i click the button and assign a data source to the grid view in the server side function using XMLHTTPREQUEST. it does not work..

any solution for this problem?


Thanks.

推荐答案

当我单击按钮并使用XMLHTTPREQUEST将数据源分配给服务器端函数中的网格视图时.它不起作用..
这不是XmlHttpRequest的工作方式!如果使用它显示内容,则需要从服务器返回一些响应给客户端-捕获它,然后使用它修改控件内容.

在ASP.NET AJAX的情况下(即使用脚本管理器和更新面板),您尝试的操作将起作用.

解决方案:
不仅仅是在服务器上分配网格源,而是在客户端获取新的网格xml并通过Javascript将其分配给网格以查看更改.
发送XMLHttpRequest之后的步骤如下:
1.生成绑定到网格的新数据的新html
2.将其发送回客户端
3.使用收到的html填充网格容器.

现在,我知道这不是您第一次问这个问题.我没有发布任何XMLHttpRequest链接,因为已经与您共享了.
我现在告诉你了这个概念.只需尝试将其放入XMLHttpRequest实现中即可.
when i click the button and assign a data source to the grid view in the server side function using XMLHTTPREQUEST. it does not work..
This is not how XmlHttpRequest work! If you use it display something, then you need to return some response back to client from server - catch it and then modify the control content with it.

What you are trying would work in case of ASP.NET AJAX (i.e. with Script manager & Update Panel).

Resolution:
Instead of just assigning the grid source on server, get back the new grid xml on client side and assign that to the grid via Javascript to see the change.
Thus steps after XMLHttpRequest sent:
1. Generate the new html of the new data bound to grid
2. Send that back to client side
3. Use the recieved html to fill in the grid container.

Now, I know this is not the first time you are asking this question. I am not posting any XMLHttpRequest links because that has already been shared with you.
I told you the concept now. Just try to put it in the XMLHttpRequest implementation.


这篇关于使用Ajax javascript调用(XMLHTTPREQUEST)Bindind网格视图不起作用.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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