Share via


FormContext Class

Definition

Information about the current <form>.

public ref class FormContext
public class FormContext
type FormContext = class
Public Class FormContext
Inheritance
FormContext

Remarks

Literal <form> elements in a view will share the default FormContext instance unless tag helpers are enabled.

Constructors

FormContext()

Properties

CanRenderAtEndOfForm

Gets or sets an indication whether extra content can be rendered at the end of the content of this <form> element. That is, EndOfFormContent will be rendered just prior to the </form> end tag.

EndOfFormContent

Gets an IHtmlContent collection that should be rendered just prior to the next </form> end tag. Do not use unless CanRenderAtEndOfForm is true.

FormData

Gets a property bag for any information you wish to associate with a <form/> in an IHtmlHelper implementation or extension method.

HasAntiforgeryToken

Gets or sets an indication the current <form> element contains an antiforgery token. Do not use unless CanRenderAtEndOfForm is true.

HasEndOfFormContent

Gets an indication the EndOfFormContent collection has been used and likely contains entries.

HasFormData

Gets an indication the FormData property bag has been used and likely contains entries.

Methods

RenderedField(String, Boolean)

Updates Microsoft.AspNetCore.Mvc.ViewFeatures.FormContext.RenderedFields to indicate fieldName has been rendered in this <form>.

RenderedField(String)

Returns an indication based on Microsoft.AspNetCore.Mvc.ViewFeatures.FormContext.RenderedFields that the given fieldName has been rendered in this <form>.

Applies to