Opening excel files from the internet opens a blank excel window

后端 未结 7 940
一生所求
一生所求 2021-01-12 08:42

A method in dumping a GridView to an Excel file to download/open from the internet was recently broken with new Windows Updates.

My code dumps from a GridView to an

7条回答
  •  北荒
    北荒 (楼主)
    2021-01-12 09:32

    Try doing following:

    Replace "attachment" from

    Response.AddHeader("content-disposition","attachment;filename=GridViewExport.xls")
    

    with "inline"

    Response.AddHeader("content-disposition","inline;filename=GridViewExport.xls")
    

    It may help!

    Content-Disposition:What are the differences between "inline" and "attachment"?

提交回复
热议问题