Skip to content

Instantly share code, notes, and snippets.

@hanssens
Created February 2, 2012 14:19
Show Gist options
  • Save hanssens/1723673 to your computer and use it in GitHub Desktop.
Save hanssens/1723673 to your computer and use it in GitHub Desktop.
[C#] MVC3 Default Controller Actions
/// <summary>
/// Default MVC 3 Controller Actions
/// </summary>
public class ObjectController : Controller
{
// GET: /Object/
public ActionResult Index()
// GET: /Object/Details/5
public ActionResult Details(int id)
// GET: /Object/Create
public ActionResult Create()
// POST: /Object/Create
[HttpPost]
public ActionResult Create(FormCollection collection)
// GET: /Object/Edit/5
public ActionResult Edit(int id)
// POST: /Object/Edit/5
[HttpPost]
public ActionResult Edit(int id, FormCollection collection)
// GET: /Object/Delete/5
public ActionResult Delete(int id)
// POST: /Object/Delete/5
[HttpPost]
public ActionResult Delete(int id, FormCollection collection)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment