public ActionResult Index() { ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application."; var htmlHelper = new HtmlHelper(new ViewContext( ControllerContext, new WebFormView(ControllerContext, "HACK"), new ViewDataDictionary(), new TempDataDictionary(), new StringWriter()), new ViewPage()); var otherViewHtml = htmlHelper.Action("About", "Home"); HttpContext.Response.Clear(); HttpContext.Response.Charset = ""; HttpContext.Response.ContentType = "application/msword"; string strFileName = "test" + ".doc"; HttpContext.Response.AddHeader("Content-Disposition", "inline;filename=" + strFileName); StringBuilder strHTMLContent = new StringBuilder(); strHTMLContent.Append(otherViewHtml); HttpContext.Response.Write(strHTMLContent); HttpContext.Response.End(); HttpContext.Response.Flush(); return View(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)