摘要: 一:返回视图: Public class HomeController:Controller{ public ActionResult Index () { Student model=new Student(); return View(model); //返回相应视图 } } 二:Content 阅读全文
posted @ 2021-08-16 14:53 程序杨% 阅读(184) 评论(0) 推荐(0)
摘要: 1.新建contorl 在ActionResult方法名上-右键-添加视图,默认ActionResult对应的方法名,就是视图的名字,可自行修改 方法一:ViewBag(存放不是主要的数据) control:传递数据(ViewBag是动态类型所以可以自定定义属性) view接收数据 直接输出使用: 阅读全文
posted @ 2021-08-16 10:47 程序杨% 阅读(165) 评论(0) 推荐(0)