【发布时间】:2014-05-26 22:37:42
【问题描述】:
我在 Ms Sql 数据库中有 Image 列。Pdf 文件在该列中。
public ActionResult Index()
{
DatabaseEntities _ context = new DatabaseEntities();
var PdfFile = _context.FileTable.where(p=>p.Id==1).Select(s=>s.FileData).FirstOrDefault();
return view();
}
我选择文件的字节并将其设置为“var PdfFile”
但我不确定如何在视图中调用 PdfFile 并在 asp.net mvc 的 html div 中显示?
任何帮助将不胜感激。
谢谢。
【问题讨论】:
-
您需要实际显示在 div 中还是直接打开它?
-
感谢回答。我需要在 div 中显示。
标签: c# asp.net-mvc pdf html view