转自:http://kb.cnblogs.com/page/50130/
ASP.NET MVC架构与实战系列之二:理解MVC路由配置
http://www.cnblogs.com/jyan/archive/2012/06/29/2569566.html
http://blog.csdn.net/kunar/article/details/6013075
ASP.NET MVC架构与实战系列之三:MVC控件解析
http://www.cnblogs.com/hmiinyu/archive/2012/05/25/2517730.html
了解.net MVC的实现原理Controller/Action
http://www.cnblogs.com/mecity/archive/2011/06/27/2090657.html
仅此一文让你明白ASP.NET MVC原理
http://www.cnblogs.com/yubaolee/p/3269043.html
ASP.NET Runtime Pipeline(续ASP.NET Http Runtime Pipeline - Part I)
http://www.cnblogs.com/artech/archive/2007/09/13/891266.html
让asp.net web api同时支持[AcceptVerbs("GET","POST")]
http://www.cnblogs.com/skys-net/p/4914588.html
MVC动态添加文本框,后台使用FormCollection接收
http://www.cnblogs.com/darrenji/p/3862512.html
Asp.Net MVC使用HtmlHelper渲染,并传递FormCollection参数的陷阱
http://www.cnblogs.com/jiessie327/archive/2009/10/13/1582117.html
MVC FormCollection collection
<input type="checkbox" name="rid" value="1"> <input type="checkbox" name="rid" value="2"> <input type="checkbox" name="rid" value="3">
Action上用FormCollection collection来获取被选中的checkbox:
当所有ckeckbox被选中时:
1、collection["rid"]的结果为:"1,2,3"
2、collection.GetValues("rid")结果为:string[] {1,2,3}
将Action动作中传递的FormCollection转变成对应的实体,可以使用Controller的TryUpdateModel()方法。
示例如下:
-
- [HttpPost]
- public ActionResult Create(FormCollection collection)
- {
- try
- {
- if (ModelState.IsValid)
- {
- var student = new Student();
- //在这里转换
- TryUpdateModel<Student>(student, collection);
- dalStudent.Add(student);
- return RedirectToAction("Index");
- }
- else
- return View();
- }
- catch
- {
- return View("Create");
- }
- }