ユーザーが Excel レポートをダウンロードできる Web ページがあります。Chrome では、IE や Firefox で正常に実行されるように、Excel ではなく aspx ページをダウンロードしようとします。
これは既知の問題ですか?回避策はありますか?
私はVBでこれを使用しています:
db.subRunReader(resultSQL)
dgProperties.DataSource = db.sqlReader
dgProperties.DataBind()
db.subCloseReader()
db.subCloseConnection()
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
dgProperties.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
Response.Redirect(Request.Url.ToString())
ありがとう。