Implemented interface member:
property
ViewContext
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper.ViewContext
1 write to ViewContext
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
HtmlHelper.cs (1)
185ViewContext = viewContext;
276 references to ViewContext
Microsoft.AspNetCore.Mvc.ViewFeatures (48)
HtmlHelper.cs (46)
87get => ViewContext.Html5DateRenderingMode; 88set => ViewContext.Html5DateRenderingMode = value; 110public dynamic ViewBag => ViewContext.ViewBag; 113public ViewDataDictionary ViewData => ViewContext.ViewData; 116public ITempDataDictionary TempData => ViewContext.TempData; 178/// Sets the <see cref="ViewContext"/>. 202ViewContext, 222var html = _htmlGenerator.GenerateAntiforgery(ViewContext); 301return NameAndIdProvider.CreateSanitizedId(ViewContext, fullName, IdAttributeDotReplacement); 465return RenderPartialCoreAsync(partialViewName, model, viewData, ViewContext.Writer); 485ViewContext, 513ViewContext.ExecutingFilePath, 519viewEngineResult = _viewEngine.FindView(ViewContext, partialViewName, isMainPage: false); 547var viewContext = new ViewContext(ViewContext, view, newViewData, writer); 599ViewContext, 700return new MvcForm(ViewContext, _htmlEncoder); 721ViewContext, 732if (ViewContext.CheckBoxHiddenInputRenderMode == CheckBoxHiddenInputRenderMode.None) 737var hiddenForCheckbox = _htmlGenerator.GenerateHiddenForCheckbox(ViewContext, modelExplorer, expression); 752if (ViewContext.CheckBoxHiddenInputRenderMode == CheckBoxHiddenInputRenderMode.EndOfForm && ViewContext.FormContext.CanRenderAtEndOfForm) 754ViewContext.FormContext.EndOfFormContent.Add(hiddenForCheckbox); 824ViewContext, 856ViewContext, 905ViewContext, 914tagBuilder.WriteTo(ViewContext.Writer, _htmlEncoder); 920ViewContext.FormContext.EndOfFormContent.Add(_htmlGenerator.GenerateAntiforgery(ViewContext)); 962ViewContext, 970tagBuilder.WriteTo(ViewContext.Writer, _htmlEncoder); 976ViewContext.FormContext.EndOfFormContent.Add(_htmlGenerator.GenerateAntiforgery(ViewContext)); 1002ViewContext, 1023var fullName = NameAndIdProvider.GetFullHtmlFieldName(ViewContext, expression); 1048ViewContext, 1098ViewContext, 1120var fullName = NameAndIdProvider.GetFullHtmlFieldName(ViewContext, expression); 1142ViewContext, 1175ViewContext, 1209ViewContext, 1243ViewContext, 1277ViewContext, 1309ViewContext, 1332var fullName = NameAndIdProvider.GetFullHtmlFieldName(ViewContext, expression); 1334(string)DefaultHtmlGenerator.GetModelStateValue(ViewContext, fullName, typeof(string)); 1345resolvedValue = DefaultHtmlGenerator.EvalString(ViewContext, expression, format);
HtmlHelperOfT.cs (2)
55nameof(ViewContext.ViewData), 81nameof(ViewContext.ViewData),
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (228)
DefaultEditorTemplatesTest.cs (1)
256helperMock.SetupGet(h => h.ViewContext).Returns(helperToCopy.ViewContext);
Rendering\HtmlHelperCheckboxTest.cs (28)
112helper.ViewContext.ClientValidationEnabled = false; 154helper.ViewContext.FormContext.CanRenderAtEndOfForm = true; 160Assert.True(helper.ViewContext.FormContext.HasEndOfFormContent); 163var hiddenTag = Assert.Single(helper.ViewContext.FormContext.EndOfFormContent); 179helper.ViewContext.CheckBoxHiddenInputRenderMode = CheckBoxHiddenInputRenderMode.None; 185Assert.False(helper.ViewContext.FormContext.HasEndOfFormContent); 199helper.ViewContext.FormContext.CanRenderAtEndOfForm = true; 200helper.ViewContext.CheckBoxHiddenInputRenderMode = CheckBoxHiddenInputRenderMode.Inline; 219helper.ViewContext.FormContext.CanRenderAtEndOfForm = true; 220helper.ViewContext.CheckBoxHiddenInputRenderMode = CheckBoxHiddenInputRenderMode.EndOfForm; 226Assert.True(helper.ViewContext.FormContext.HasEndOfFormContent); 229var hiddenTag = Assert.Single(helper.ViewContext.FormContext.EndOfFormContent); 245helper.ViewContext.FormContext.CanRenderAtEndOfForm = false; 246helper.ViewContext.CheckBoxHiddenInputRenderMode = CheckBoxHiddenInputRenderMode.EndOfForm; 252Assert.False(helper.ViewContext.FormContext.HasEndOfFormContent); 284helper.ViewContext.ClientValidationEnabled = false; 303helper.ViewContext.ClientValidationEnabled = false; 325helper.ViewContext.ClientValidationEnabled = false; 346helper.ViewContext.ClientValidationEnabled = false; 369helper.ViewContext.ClientValidationEnabled = false; 389helper.ViewContext.ClientValidationEnabled = false; 410helper.ViewContext.ClientValidationEnabled = false; 429helper.ViewContext.ClientValidationEnabled = false; 486helper.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"; 506helper.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"; 527helper.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"; 731helper.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"; 798helper.ViewContext.ClientValidationEnabled = false;
Rendering\HtmlHelperDropDownListExtensionsTest.cs (9)
32helper.ViewContext.ClientValidationEnabled = false; 56helper.ViewContext.ClientValidationEnabled = false; 82helper.ViewContext.ClientValidationEnabled = false; 107helper.ViewContext.ClientValidationEnabled = false; 134helper.ViewContext.ClientValidationEnabled = false; 156helper.ViewContext.ClientValidationEnabled = false; 182helper.ViewContext.ClientValidationEnabled = false; 208helper.ViewContext.ClientValidationEnabled = false; 234helper.ViewContext.ClientValidationEnabled = false;
Rendering\HtmlHelperFormExtensionsTest.cs (102)
282htmlHelper.ViewContext, 291.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 296Assert.NotNull(htmlHelper.ViewContext); 297var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 319htmlHelper.ViewContext, 328.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 333Assert.NotNull(htmlHelper.ViewContext); 334var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 356htmlHelper.ViewContext, 366Assert.NotNull(htmlHelper.ViewContext); 367var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 390htmlHelper.ViewContext, 402.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 408Assert.NotNull(htmlHelper.ViewContext); 409var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 434htmlHelper.ViewContext, 446.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 452Assert.NotNull(htmlHelper.ViewContext); 453var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 478htmlHelper.ViewContext, 487.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 492Assert.NotNull(htmlHelper.ViewContext); 493var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 518htmlHelper.ViewContext, 528Assert.NotNull(htmlHelper.ViewContext); 529var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 552htmlHelper.ViewContext, 561.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 566Assert.NotNull(htmlHelper.ViewContext); 567var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 592htmlHelper.ViewContext, 601.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 606Assert.NotNull(htmlHelper.ViewContext); 607var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 633htmlHelper.ViewContext, 642.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 647Assert.NotNull(htmlHelper.ViewContext); 648var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 674htmlHelper.ViewContext, 686.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 692Assert.NotNull(htmlHelper.ViewContext); 693var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 720htmlHelper.ViewContext, 732.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 738Assert.NotNull(htmlHelper.ViewContext); 739var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 766htmlHelper.ViewContext, 778.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 784Assert.NotNull(htmlHelper.ViewContext); 785var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 812htmlHelper.ViewContext, 821.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 826Assert.NotNull(htmlHelper.ViewContext); 827var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 860htmlHelper.ViewContext, 870Assert.NotNull(htmlHelper.ViewContext); 871var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 900htmlHelper.ViewContext, 908.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 913Assert.NotNull(htmlHelper.ViewContext); 914var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 938htmlHelper.ViewContext, 946.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 951Assert.NotNull(htmlHelper.ViewContext); 952var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 976htmlHelper.ViewContext, 985Assert.NotNull(htmlHelper.ViewContext); 986var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 1009htmlHelper.ViewContext, 1017.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 1022Assert.NotNull(htmlHelper.ViewContext); 1023var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 1047htmlHelper.ViewContext, 1055.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 1060Assert.NotNull(htmlHelper.ViewContext); 1061var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 1085htmlHelper.ViewContext, 1094Assert.NotNull(htmlHelper.ViewContext); 1095var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 1120htmlHelper.ViewContext, 1128.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 1133Assert.NotNull(htmlHelper.ViewContext); 1134var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 1159htmlHelper.ViewContext, 1170.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 1176Assert.NotNull(htmlHelper.ViewContext); 1177var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 1203htmlHelper.ViewContext, 1214.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 1220Assert.NotNull(htmlHelper.ViewContext); 1221var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 1247htmlHelper.ViewContext, 1258.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 1264Assert.NotNull(htmlHelper.ViewContext); 1265var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 1291htmlHelper.ViewContext, 1299.Setup(g => g.GenerateAntiforgery(htmlHelper.ViewContext)) 1304Assert.NotNull(htmlHelper.ViewContext); 1305var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 1336htmlHelper.ViewContext, 1345Assert.NotNull(htmlHelper.ViewContext); 1346var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer);
Rendering\HtmlHelperFormTest.cs (27)
130Assert.NotNull(htmlHelper.ViewContext); 131var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 134Assert.NotNull(htmlHelper.ViewContext.HttpContext); 135var request = htmlHelper.ViewContext.HttpContext.Request; 180Assert.NotNull(htmlHelper.ViewContext); 181var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 184Assert.NotNull(htmlHelper.ViewContext.HttpContext); 185var request = htmlHelper.ViewContext.HttpContext.Request; 242Assert.NotNull(htmlHelper.ViewContext); 243var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 292Assert.NotNull(htmlHelper.ViewContext); 293var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 320Assert.NotNull(htmlHelper.ViewContext); 321var writer = Assert.IsAssignableFrom<StringWriter>(htmlHelper.ViewContext.Writer); 340var viewContext = htmlHelper.ViewContext; 353htmlHelper.ViewContext.FormContext.EndOfFormContent.Add(tagBuilder); 387var viewContext = htmlHelper.ViewContext; 425var viewContext = htmlHelper.ViewContext; 464var viewContext = htmlHelper.ViewContext; 502var viewContext = htmlHelper.ViewContext; 542var viewContext = htmlHelper.ViewContext; 581var viewContext = htmlHelper.ViewContext; 621var viewContext = htmlHelper.ViewContext; 658var viewContext = htmlHelper.ViewContext; 701var viewContext = htmlHelper.ViewContext; 743var viewContext = htmlHelper.ViewContext; 787var viewContext = htmlHelper.ViewContext;
Rendering\HtmlHelperHiddenTest.cs (9)
342helper.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"; 357helper.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"; 375helper.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"; 406helper.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"; 683helper.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"; 702helper.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"; 894helper.ViewContext.ClientValidationEnabled = false; 912helper.ViewContext.ClientValidationEnabled = false; 930helper.ViewContext.ClientValidationEnabled = false;
Rendering\HtmlHelperListBoxExtensionsTest.cs (6)
32helper.ViewContext.ClientValidationEnabled = false; 58helper.ViewContext.ClientValidationEnabled = false; 83helper.ViewContext.ClientValidationEnabled = false; 105helper.ViewContext.ClientValidationEnabled = false; 130helper.ViewContext.ClientValidationEnabled = false; 155helper.ViewContext.ClientValidationEnabled = false;
Rendering\HtmlHelperPasswordTest.cs (7)
100helper.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"; 118helper.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"; 133helper.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"; 275helper.ViewContext.ViewData.TemplateInfo.HtmlFieldPrefix = "MyPrefix"; 383helper.ViewContext.ClientValidationEnabled = false; 401helper.ViewContext.ClientValidationEnabled = false; 419helper.ViewContext.ClientValidationEnabled = false;
Rendering\HtmlHelperRadioButtonExtensionsTest.cs (3)
54helper.ViewContext.ClientValidationEnabled = false; 74helper.ViewContext.ClientValidationEnabled = false; 107helper.ViewContext.ClientValidationEnabled = false;
Rendering\HtmlHelperSelectTest.cs (14)
431helper.ViewContext.ClientValidationEnabled = false; 469helper.ViewContext.ClientValidationEnabled = false; 494helper.ViewContext.ClientValidationEnabled = false; 522helper.ViewContext.ClientValidationEnabled = false; 549helper.ViewContext.ClientValidationEnabled = false; 565helper.ViewContext.ClientValidationEnabled = false; 581helper.ViewContext.ClientValidationEnabled = false; 834helper.ViewContext.ClientValidationEnabled = false; 872helper.ViewContext.ClientValidationEnabled = false; 897helper.ViewContext.ClientValidationEnabled = false; 925helper.ViewContext.ClientValidationEnabled = false; 952helper.ViewContext.ClientValidationEnabled = false; 968helper.ViewContext.ClientValidationEnabled = false; 984helper.ViewContext.ClientValidationEnabled = false;
Rendering\HtmlHelperTest.cs (4)
296.ViewContext; 305Assert.Same(helperToContextualize.ViewContext, viewContext); 317.ViewContext; 337.ViewContext;
Rendering\HtmlHelperTextAreaExtensionsTest.cs (5)
21helper.ViewContext.ClientValidationEnabled = false; 40helper.ViewContext.ClientValidationEnabled = false; 59helper.ViewContext.ClientValidationEnabled = false; 78helper.ViewContext.ClientValidationEnabled = false; 98helper.ViewContext.ClientValidationEnabled = false;
Rendering\HtmlHelperTextBoxExtensionsTest.cs (9)
22helper.ViewContext.ClientValidationEnabled = false; 40helper.ViewContext.ClientValidationEnabled = false; 58helper.ViewContext.ClientValidationEnabled = false; 76helper.ViewContext.ClientValidationEnabled = false; 94helper.ViewContext.ClientValidationEnabled = false; 122helper.ViewContext.ClientValidationEnabled = false; 150helper.ViewContext.ClientValidationEnabled = false; 176helper.ViewContext.ClientValidationEnabled = false; 196helper.ViewContext.ClientValidationEnabled = false;
Rendering\HtmlHelperValidationSummaryTest.cs (4)
184html.ViewContext.ClientValidationEnabled = false; 208html.ViewContext.ClientValidationEnabled = clientValidationEnabled; 233html.ViewContext.ClientValidationEnabled = clientValidationEnabled; 259html.ViewContext.ClientValidationEnabled = clientValidationEnabled;