Table of Contents

Class MvcForm

Namespace
System.Web.Mvc.Html
Assembly
System.Web.Mvc.dll

Represents an HTML form element in an MVC view.

public class MvcForm : IDisposable
Inheritance
MvcForm
Implements
Inherited Members

Constructors

MvcForm(HttpResponseBase)

Initializes a new instance of the MvcForm class using the specified HTTP response object.

[Obsolete("This constructor is obsolete, because its functionality has been moved to MvcForm(ViewContext) now.", true)]
public MvcForm(HttpResponseBase httpResponse)

Parameters

httpResponse HttpResponseBase

The HTTP response object.

Exceptions

ArgumentNullException

The httpResponse parameter is null.

MvcForm(ViewContext)

Initializes a new instance of the MvcForm class using the specified view context.

public MvcForm(ViewContext viewContext)

Parameters

viewContext ViewContext

An object that encapsulates the information that is required in order to render a view.

Exceptions

ArgumentNullException

The viewContext parameter is null.

Methods

Dispose()

Releases all resources that are used by the current instance of the MvcForm class.

public void Dispose()

Dispose(bool)

Releases unmanaged and, optionally, managed resources used by the current instance of the MvcForm class.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

EndForm()

Ends the form and disposes of all form resources.

public void EndForm()