【发布时间】:2011-08-30 18:40:53
【问题描述】:
我有一组以 CSV 格式存在于内存中的数据。我的控制器中有这个方法:
public FileContentResult ItemsAsExcelExport(){
var model = _itemService.GetExcelExportModel();
return new FileContentResult(model.CSVData, model.MimeType){FileDownloadName = model.FileName};
}
这里的问题是我的 model.CSVData 属性返回一组简单的逗号分隔值。我不确定如何满足 FileContentResult 构造函数的 fileContents 参数。它要求一个字节数组。
提前致谢。
【问题讨论】:
标签: asp.net-mvc-3 export-to-excel filecontentresult