ASP.NET Grid AjaxPanel 下载问题
我有一个 Telerik 网格,它正在执行搜索、排序、过滤等操作。为了让客户满意,我们将此控件放在 ajax 面板中以获得无缝体验。
现在,我们向网格添加了一项新功能,客户可以将整行信息下载为 csv 文件。由于响应是一个文件,ajax 面板尝试解析输出并引发以下异常:
Microsoft JScript 运行时错误:Sys.WebForms.PageRequestManagerParserErrorException:无法解析从服务器收到的消息。出现此错误的常见原因是通过调用 Response.Write()、响应筛选器、HttpModules 或启用服务器跟踪来修改响应。 详细信息:解析“ࡱ”附近时出错。
您能否帮助我确保这两个功能(Ajax 和下载)都到位,没有任何错误?
谢谢, 马赫什
I have a telerik grid which is performing operations like searching,sorting,filtering etc. To make customers happy, we put this control in an ajax panel for seamless experience.
Now, we added a new functionality to the grid where the customer can download the entire row information as a csv file. As the response is a file, ajax panel is trying to parse the output and throwing the following exception:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'ࡱ'.
Could you please help me in having both functionalities( Ajax and Download) in place without any error??
Thanks,
Mahesh
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来我们在从 RadAJAXPanel 中导出数据时也遇到了问题。
我们在我们的地方所做的就是存储来自网格和任何过滤器、排序和过滤的数据。会话对象中的分组。
然后,为了让用户可以停留在同一页面上,我们通过 JavaScript 弹出一个窗口,将用户引导到一个通用处理程序(ashx 文件),该处理程序提供 XLS、CVS、PDF 或我们在查询字符串中指定的任何格式。
然后会话对象被清理。
It looks like we had problems exporting data from within a RadAJAXPanel also.
What we did at our place was store the data from the grid and any filters, sorting & grouping in session objects.
Then, so the user can stay on the same page, we popped up a window thru JavaScript to direct the user to a generic handler(ashx file) that served the XLS, CVS, PDF or whatever format we specified in the querystring.
Then the session objects were cleaned.
您应该使用 RadAJAXManager 和 RadAJAXPanel 而不是 ASP Scriptmanager 和 RadAJAXPanel。阿贾克斯面板。它们与 Telerik 控件配合使用效果更好。
You should use the RadAJAXManager and RadAJAXPanel instead of the ASP Scriptmanager & Ajax Panel. They work a lot better with Telerik controls.