比较乱,先记录下再说
Models and Model Binders in MVC Applications(model绑定) http://msdn.microsoft.com/en-us/library/dd410405.aspx
Walkthrough: Using MVC View Templates with Data Scaffolding http://msdn.microsoft.com/en-us/library/dd405231.aspx
Rendering a Form in ASP.NET MVC Using HTML Helpers(重要属性) http://msdn.microsoft.com/en-us/library/dd410596.aspx
ActionLink — Links to an action method.
BeginForm * — Marks the start of a form and links to the action method that renders the form.
CheckBox * — Renders a check box.
DropDownList * — Renders a drop-down list.
Hidden — Embeds information in the form that is not rendered for the user to see.
ListBox — Renders a list box.
Password — Renders a text box for entering a password.
RadioButton * — Renders a radio button.
TextArea — Renders a text area (multi-line text box).
TextBox * — Renders a text box.
{
static List<Person> people = new List<Person>();
//
// GET: /Person/
public ActionResult Index()
{
return View(people);
}
//
// GET: /Person/Details/5
public ActionResult Details(Person person)
{
return View(person);
}
//
// GET: /Person/Create
public ActionResult Create()
{
return View();
}
//
// POST: /Person/Create
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(Person person)
{
if (!ModelState.IsValid)
{
return View("Create", person);
}
people.Add(person);
return RedirectToAction("Index");
}
}