예제 #1
0
 // 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);
 }
예제 #2
0
 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);
 }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }