首页 > 代码库 > ASP.net MVC把Html Table导出Excel

ASP.net MVC把Html Table导出Excel

        [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端        }

 

ASP.net MVC把Html Table导出Excel