无法在 Atlas 更新面板中生成 Excel

发布于 2024-07-09 04:32:28 字数 148 浏览 4 评论 0原文

我无法在 Atlas 更新面板中生成 Excel。 (因为更新面板中无法结束/写入响应[XML])我不想使用asp:updatepanel ..还有其他方法吗?

任何正确的答案将不胜感激......

提前致谢

I am unable to generate an excel in an Atlas Update Panel. (Since a response cannot be ended/written [XML] in the update panel) I don't want to use asp:updatepanel .. Is there any other way?

Any correct answer will be highly appreciated...

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ㄖ落Θ余辉 2024-07-16 04:32:28

我猜你不需要这样做,因为你可以发送一个通用请求来生成 excel 文件,而无需离开当前页面,从而产生与使用 AJAX 相同的效果。

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    Response.clear()
    Response.ContentType = "application/ms-excel;"
    Response.AppendHeader("content-disposition", "attachment; filename=""excel-file.xml""")

    'write all the file to the response object


    Response.Flush()
    Response.End()

End Sub

I guess that you don't need to, since you can send a common request to generate the excel file, without leaving the current page, causing the same effect as doing it with AJAX.

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    Response.clear()
    Response.ContentType = "application/ms-excel;"
    Response.AppendHeader("content-disposition", "attachment; filename=""excel-file.xml""")

    'write all the file to the response object


    Response.Flush()
    Response.End()

End Sub
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文