ASP.NET MVC Reference

The topics in this section describe the public namespaces, classes, and interfaces that support ASP.NET MVC. These namespaces and classes are in the System.Web.Mvc assembly.

ASP.NET MVC implements the Model-View-Controller (MVC) pattern, which helps Web developers build Web sites that are easy to maintain, because MVC decreases the dependency between application layers. ASP.NET MVC also improves the testability of ASP.NET Web applications by supporting test-driven development (TDD).

Related Topics

Title

Description

System.Web.Mvc namespace

Contains classes and interfaces that support the MVC pattern for ASP.NET Web applications. This namespace includes classes that represent controllers, controller factories, action results, views, partial views, ad model binders.

System.Web.Mvc.Ajax namespace

Contains classes that support AJAX scripts in an ASP.NET MVC application. The namespace includes support for AJAX scripts and AJAX option settings.

>System.Web.Mvc.Html namespace

Contains classes that help render HTML controls in an MVC application. The namespace includes classes that support forms, input controls, links, partial views, and validation.

See Also

Other Resources

Tags :


Community Content

Thomas Lee
System.Web.Mvc.Html is missing the link
System.Web.Mvc.Html ===> http://msdn.microsoft.com/en-us/library/system.web.mvc.html.aspx
Tags : contentbug

Thomas Lee
FlashGet add-in crashes this page if I click "Switch on low bandwidth view"
Thankfully, I dislike the "low bandwidth view" and fortunately, I do not require it.
The FlashGet* add-in crashes IE7 on my WinXP Pro SP3 PC as soon as I click
the "Switch on low bandwitch view". jccatch.dll and IE7 are only semi-compatible AFAIK.

Regards,
Gerry (Lowry)

* http://www.flashget.com/index_en.htm
Tags : contentbug?

Thomas Lee
mia: View ?? (8 overloads) ~~ conspicuously absent!!
Sometimes it seems that I'm alone in my complaints about msdn documentation.

Missing in action: View
http://msdn.microsoft.com/en-us/library/system.web.mvc.aspx
"System.Web.Mvc Namespace"

View as a method, example: return View( ... ); is missing in action.

Even if I did find View(...), I have strong and reasonable doubts that it would be well documented.

At this time (2009-08-22), one can get hints from the Intellisense which reveals eight overloads:

// every current form of View returns a System.Web.Mvc.ViewResult ~~ 2009-08-22

// return View("viewName","myMasterView", myObjectModel);
// 8 ViewResult Controller.View(string viewName, string masterViewName, object model)

// return View("viewName","myMasterView");
// 7 ViewResult Controller.View(string viewName, string masterViewName)

// return View("viewName", myObjectModel);
// 6 ViewResult Controller.View(string viewName, object model)

// return View(myIView, myObjectModel);
// 5 ViewResult Controller.View(IView View, object model)

// return View("viewName");
// 4 ViewResult Controller.View(string viewName) ~~ the name of the partial view

// return View(myObjectModel);
// 3 ViewResult Controller.View(object model)

// return View(myIView);
// 2 ViewResult Controller.View(IView View)

// return View();
// 1 ViewResult Controller.View()


The simplest overload, above, uses the name of the Controller ActionResult
for some behind the scenes magic. Example,
if you are in
public ActionResult Register,
return View();
will render your Register.aspx page (which of course must exist).

This is equivalent to the explicit form (overload 4)
return View("Register");
Personally, the explicit form is clear and therefore my recommendation.

imnsho, the first form is for lazy coders.

regards,
gerry lowry
http://gerrylowryprogrammer.com
gerry.lowry@abilitybusinesscomputerservices.com
Tags : contentbug

Page view tracker