// GET: Home public void Index() { ViewData.Model = new Contact { Name = "屈文斌", PhoneNo = "13718312531", Email = "*****@*****.**" }; SimpleRazorView view = new SimpleRazorView("~/Views/Home/Index.cshtml"); ViewContext viewContext = new ViewContext(ControllerContext, view, ViewData, TempData, Response.Output); view.Render(viewContext, viewContext.Writer); }
public void Index() { ViewData.Model = new Contact { Name = "张三", PhoneNo = "123456789", EmailAddress = "*****@*****.**" }; SimpleRazorView view = new SimpleRazorView("~/Views/Home/Index.cshtml"); ViewContext viewContext = new ViewContext(ControllerContext, view,ViewData, TempData, Response.Output); view.Render(viewContext, viewContext.Writer); }
public void Index() { ViewData.Model = new Contact { Name = "张三", PhoneNo = "123456789", EmailAddress = "*****@*****.**" }; SimpleRazorView view = new SimpleRazorView("~/Views/Home/Index.cshtml"); ViewContext viewContext = new ViewContext(ControllerContext, view, ViewData, TempData, Response.Output); view.Render(viewContext, viewContext.Writer); }
public void ViewTest() { ViewData.Model = new CurrentUser { Id = 11, Name = "Eleven", Email = "*****@*****.**" }; SimpleRazorView view = new SimpleRazorView("~/Views/Pipe/ViewTest.cshtml"); ViewContext viewContext = new ViewContext(ControllerContext, view, ViewData, TempData, Response.Output); view.Render(viewContext, viewContext.Writer); }