MVC学习Day01
2015-10-27 10:26
316 查看
![](http://images2015.cnblogs.com/blog/762322/201510/762322-20151027095507497-2086240775.png)
~~
![](http://images2015.cnblogs.com/blog/762322/201510/762322-20151027095553825-893768864.png)
~~
![](http://images2015.cnblogs.com/blog/762322/201510/762322-20151027095626435-1662759702.png)
======================================================================================================================
![](http://images2015.cnblogs.com/blog/762322/201510/762322-20151027100448966-421140752.png)
~~
![](http://images2015.cnblogs.com/blog/762322/201510/762322-20151027100548185-136869345.png)
=========================================================================================================================
![](http://images2015.cnblogs.com/blog/762322/201510/762322-20151027100630341-1839145099.png)
~~
![](http://images2015.cnblogs.com/blog/762322/201510/762322-20151027100808544-251267964.png)
=========================================================================================================================
![](http://images2015.cnblogs.com/blog/762322/201510/762322-20151027100913794-2111368313.png)
~~
![](http://images2015.cnblogs.com/blog/762322/201510/762322-20151027101107091-799789057.png)
~~
![](http://images2015.cnblogs.com/blog/762322/201510/762322-20151027101209404-815991583.png)
=========================================================================================================================
![](http://images2015.cnblogs.com/blog/762322/201510/762322-20151027101405341-1116994374.png)
~~
![](http://images2015.cnblogs.com/blog/762322/201510/762322-20151027101434888-500307156.png)
![](http://images2015.cnblogs.com/blog/762322/201510/762322-20151027101519513-2003499173.png)
=========================================================================================================================
★DropDownList的添加方式,,用到了初始化器,行为中的代码如下:
public ActionResult Index() { ViewBag.sh = "123"; List<SelectListItem> list = new List<SelectListItem>(); list.Add(new SelectListItem() { Selected = false, Text = "济南", Value = "1", }); list.Add(new SelectListItem() { Selected = false, Text = "青岛", Value = "2", }); ViewBag.ddlData = list; return View(); }
★视图中的绑定代码如下:注意自动绑定的前提
@Html.DropDownList("ddlData")
★行为的重载的前提条件,代码如下:
//行为的重载,满足两点要求1.行为的名字必须相同2.签名不相同3.http请求不同,默认是[HttpGet] [HttpPost] public ActionResult TianJiaPerson(Person p1) { ViewData.Model = p1; return View("TianJiaPerson1"); }
相关文章推荐
- 1. Python基础知识
- ImageView.ScaleType设置图解
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- spring log4j.properties
- 如何理解 if let 与guard let