Hi there,
Can anyone tell help me understand the new CRUD scaffolding that is included with MVC 2?
Let me explain, for example below you have 2 Create Actions...
Now i presume that if i have the form "Post to itself" then the second with Attribute POST is executed - IS THIS CORRECT? so a form within a view that when Submitted submits to itself??, but when would the standard Create be called i.e. the 1 that has the // GET comment at the start.
I do understand that the default action is Index hence this would be normally called when my page is displayed but i can't seem to find any info on Create action. I presume its a magic word hence it needs to be called Create ???
// GET: /Customer/Create
public ActionResult Create()
{
return View();
}
//
// POST: /Customer/Create
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(FormCollection collection)
{
try
{
// TODO: Add insert logic here
return RedirectToAction("Index");
}
catch
{
return View();
}
}