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