The view context object (ViewContext
) is available in view components (which will be discussed in a later chapter) and as a property of Razor Pages (IRazorPage
), meaning you can access it in views. In it, besides the usual context properties (HttpContext
, ModelStateDictionary
, RouteData
, ActionDescriptor
) you also have access to the form context (FormContext
) object. This object offers the following properties:
CanRenderAtEndOfForm
(bool
): Indicates whether the form can render additional contents (theEndOfFormContent
) at its endEndOfFormContent
(IList<IHtmlContent>
): A collection of contents to add at the end of the form (before the</form>
tag)FormData
(IDictionary<string, object>
): The submitted form dataHasAntiforgeryToken
(bool
): Indicates whether the form is rendering the anti-forgery token, which depends on how theBeginForm
method was called; the default istrue
HasEndOfFormContent
(bool
): Indicates whether any end of form content has been addedHasFormData...