
[HttpPost]
public ActionResult ExportExcel(FormCollection form)
{ string strHtml = form["hHtml"];
strHtml = HttpUtility.HtmlDecode(strHtml);//Html解码
byte[] b = System.Text.Encoding.Default.GetBytes(strHtml);//字串转byte阵列
return File(b, "application/vnd.ms-excel", "这是Excel.xls");//输出档案给Client端
}