7 writes to FormContext
Microsoft.AspNetCore.Mvc.TagHelpers (2)
RenderAtEndOfFormTagHelper.cs (2)
37ViewContext.FormContext = new FormContext 62ViewContext.FormContext = new FormContext();
Microsoft.AspNetCore.Mvc.ViewFeatures (5)
HtmlHelper.cs (2)
236_viewContext.FormContext = new FormContext 253_viewContext.FormContext = new FormContext
Rendering\MvcForm.cs (1)
60_viewContext.FormContext = new FormContext();
Rendering\ViewContext.cs (2)
68FormContext = new FormContext(); 96FormContext = viewContext.FormContext;
52 references to FormContext
Microsoft.AspNetCore.Mvc.TagHelpers (4)
InputTagHelper.cs (3)
257ViewContext.FormContext.InvariantField(fullName)) 355if (ViewContext.CheckBoxHiddenInputRenderMode == CheckBoxHiddenInputRenderMode.EndOfForm && ViewContext.FormContext.CanRenderAtEndOfForm) 357ViewContext.FormContext.EndOfFormContent.Add(hiddenForCheckboxTag);
RenderAtEndOfFormTagHelper.cs (1)
51var formContext = ViewContext.FormContext;
Microsoft.AspNetCore.Mvc.TagHelpers.Test (14)
InputTagHelperTest.cs (11)
451Assert.False(viewContext.FormContext.HasEndOfFormContent); 875.Callback(() => viewContext.FormContext.InvariantField(tagBuilder.Attributes["name"], usesInvariantFormatting)) 958Assert.False(viewContext.FormContext.HasEndOfFormContent); 984viewContext.FormContext.CanRenderAtEndOfForm = true; 1018Assert.False(viewContext.FormContext.HasEndOfFormContent); 1044viewContext.FormContext.CanRenderAtEndOfForm = true; 1078Assert.Equal(expectedEndOfFormContent, string.Join("", viewContext.FormContext.EndOfFormContent.Select(html => HtmlContentUtilities.HtmlContentToString(html)))); 1104viewContext.FormContext.CanRenderAtEndOfForm = false; 1138Assert.False(viewContext.FormContext.HasEndOfFormContent); 1345viewContext.FormContext.CanRenderAtEndOfForm = true; 1381Assert.Equal(expectedEndOfFormContent, string.Join("", viewContext.FormContext.EndOfFormContent.Select(html => HtmlContentUtilities.HtmlContentToString(html))));
RenderAtEndOfFormTagHelperTest.cs (3)
52Assert.True(viewContext.FormContext.CanRenderAtEndOfForm); 55viewContext.FormContext.EndOfFormContent.Add(item); 98viewContext.FormContext.EndOfFormContent.Add(item);
Microsoft.AspNetCore.Mvc.ViewFeatures (14)
DefaultHtmlGenerator.cs (3)
169var formContext = viewContext.FormContext; 734var formContext = viewContext.ClientValidationEnabled ? viewContext.FormContext : null; 1188viewContext.FormContext.InvariantField(fullName, true);
DefaultValidationHtmlAttributeProvider.cs (1)
53var formContext = viewContext.ClientValidationEnabled ? viewContext.FormContext : null;
HtmlHelper.cs (4)
752if (ViewContext.CheckBoxHiddenInputRenderMode == CheckBoxHiddenInputRenderMode.EndOfForm && ViewContext.FormContext.CanRenderAtEndOfForm) 754ViewContext.FormContext.EndOfFormContent.Add(hiddenForCheckbox); 920ViewContext.FormContext.EndOfFormContent.Add(_htmlGenerator.GenerateAntiforgery(ViewContext)); 976ViewContext.FormContext.EndOfFormContent.Add(_htmlGenerator.GenerateAntiforgery(ViewContext));
Rendering\MvcForm.cs (1)
65var formContext = _viewContext.FormContext;
Rendering\ViewContext.cs (4)
96FormContext = viewContext.FormContext; 115/// Gets or sets the <see cref="FormContext"/> for the form element being rendered. 210/// Gets the <see cref="FormContext"/> if <see cref="ClientValidationEnabled"/> is enabled. 215return ClientValidationEnabled ? FormContext : null;
ValidationHtmlAttributeProvider.cs (1)
61var formContext = viewContext.ClientValidationEnabled ? viewContext.FormContext : null;
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (20)
DefaultHtmlGeneratorTest.cs (5)
379var didForceInvariantFormatting = viewContext.FormContext.InvariantField(expression); 409var didForceInvariantFormatting = viewContext.FormContext.InvariantField(expression); 966viewContext.FormContext.CanRenderAtEndOfForm = true; 967viewContext.FormContext.HasAntiforgeryToken = hasAntiforgeryToken; 991viewContext.FormContext.HasAntiforgeryToken = hasAntiforgeryToken;
DefaultValidationHtmlAttributeProviderTest.cs (2)
162viewContext.FormContext.RenderedField(nameof(Model.HasValidatorsProperty), value: true); 196viewContext.FormContext.RenderedField(nameof(Model.HasValidatorsProperty), value: true);
Rendering\HtmlHelperCheckboxTest.cs (10)
154helper.ViewContext.FormContext.CanRenderAtEndOfForm = true; 160Assert.True(helper.ViewContext.FormContext.HasEndOfFormContent); 163var hiddenTag = Assert.Single(helper.ViewContext.FormContext.EndOfFormContent); 185Assert.False(helper.ViewContext.FormContext.HasEndOfFormContent); 199helper.ViewContext.FormContext.CanRenderAtEndOfForm = true; 219helper.ViewContext.FormContext.CanRenderAtEndOfForm = true; 226Assert.True(helper.ViewContext.FormContext.HasEndOfFormContent); 229var hiddenTag = Assert.Single(helper.ViewContext.FormContext.EndOfFormContent); 245helper.ViewContext.FormContext.CanRenderAtEndOfForm = false; 252Assert.False(helper.ViewContext.FormContext.HasEndOfFormContent);
Rendering\HtmlHelperFormTest.cs (1)
353htmlHelper.ViewContext.FormContext.EndOfFormContent.Add(tagBuilder);
Rendering\ViewContextTests.cs (2)
67Assert.Same(originalContext.FormContext, context.FormContext);