Generate an Excel XML document in Asp.net MVC Web Site

后端 未结 2 2073
情深已故
情深已故 2021-01-06 16:42

I have an ASP.Net MVC site that generates a Microsoft Excel 2003 XML formatted spreadsheet. The spreadsheet looks good, the controller and views both work, but the file won

相关标签:
2条回答
  • 2021-01-06 16:50

    Your problem may be in using the file extension .xml, which you're adding in your header. My code that does this same thing does not have a file extension at all.

    You might try dropping that .xml extension, or changing it to .xls or .csv.

    0 讨论(0)
  • 2021-01-06 16:50

    Try with

    Response.ContentType = "application/vnd.ms-excel"
    

    And keep the .XML extension.

    0 讨论(0)
提交回复
热议问题