Implemented interface member:
property
ViewData
Microsoft.AspNetCore.Mvc.Rendering.IHtmlHelper<TModel>.ViewData
2 writes to ViewData
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
HtmlHelperOfT.cs (2)
60
ViewData
= viewContext.ViewData as ViewDataDictionary<TModel>;
73
ViewData
= new ViewDataDictionary<TModel>(viewContext.ViewData, viewContext.ViewData.Model);
268 references to ViewData
Microsoft.AspNetCore.Mvc.ViewFeatures (4)
HtmlHelperOfT.cs (4)
62
if (
ViewData
== null)
77
if (
ViewData
== null)
156
new ViewDataDictionary<TModelItem>(
ViewData
, model: null),
311
return _modelExpressionProvider.CreateModelExpression(
ViewData
, expression);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (264)
DefaultDisplayTemplatesTest.cs (8)
104
html.
ViewData
.TemplateInfo.AddVisited("foo");
105
html.
ViewData
.TemplateInfo.AddVisited("bar");
215
var templateInfo = html.
ViewData
.TemplateInfo;
241
var viewData = html.
ViewData
;
267
helper.
ViewData
["Property1"] = "ViewData string";
289
helper.
ViewData
["Property1"] = "ViewData string";
334
helper.
ViewData
["Property1"] = "ViewData string";
363
helper.
ViewData
["Property1"] = "ViewData string";
DefaultEditorTemplatesTest.cs (30)
257
helperMock.SetupGet(h => h.ViewData).Returns(helperToCopy.
ViewData
);
294
html.
ViewData
.TemplateInfo.AddVisited("foo");
295
html.
ViewData
.TemplateInfo.AddVisited("bar");
301
Assert.Equal(html.
ViewData
.ModelMetadata.NullDisplayText, HtmlContentUtilities.HtmlContentToString(result));
327
html.
ViewData
.TemplateInfo.AddVisited("foo");
328
html.
ViewData
.TemplateInfo.AddVisited("bar");
453
var templateInfo = html.
ViewData
.TemplateInfo;
482
var templateInfo = html.
ViewData
.TemplateInfo;
504
var templateInfo = html.
ViewData
.TemplateInfo;
529
var viewData = helper.
ViewData
;
553
var viewData = helper.
ViewData
;
583
helper.
ViewData
["Property1"] = "True";
586
helper.
ViewData
.TemplateInfo.FormattedModelValue = "Formatted string";
618
helper.
ViewData
.TemplateInfo.FormattedModelValue = "Formatted string";
658
helper.
ViewData
["Property1"] = "True";
661
helper.
ViewData
.TemplateInfo.FormattedModelValue = "Formatted string";
703
helper.
ViewData
.TemplateInfo.FormattedModelValue = "Formatted string";
743
helper.
ViewData
["Property1"] = "True";
746
helper.
ViewData
.TemplateInfo.FormattedModelValue = "Formatted string";
788
helper.
ViewData
.TemplateInfo.FormattedModelValue = "Formatted string";
814
helper.
ViewData
["Property1"] = "ViewData string";
859
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "FieldPrefix";
931
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "FieldPrefix";
1003
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "FieldPrefix";
1072
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "FieldPrefix";
1142
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "FieldPrefix";
1209
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "FieldPrefix";
1231
helper.
ViewData
["Property1"] = "ViewData string";
1280
helper.
ViewData
["Property1"] = "ViewData string";
1311
helper.
ViewData
["Property1"] = "ViewData string";
Rendering\HtmlHelperCheckboxTest.cs (18)
266
helper.
ViewData
.ModelState.SetModelValue("Property1", new string[] { "false" }, "false");
285
helper.
ViewData
.Model = new TestModel();
304
helper.
ViewData
.Remove(nameof(TestModel.Property1));
305
helper.
ViewData
["Prefix.Property1"] = true;
306
helper.
ViewData
.Model = new TestModel();
307
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
326
helper.
ViewData
.Remove(nameof(TestModel.Property1));
327
helper.
ViewData
["Prefix"] = new TestModel { Property1 = true };
328
helper.
ViewData
.Model = new TestModel();
347
helper.
ViewData
.Remove(nameof(TestModel.Property1));
348
helper.
ViewData
["Prefix"] = new TestModel { Property1 = true };
349
helper.
ViewData
.Model = new TestModel();
350
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
370
helper.
ViewData
.Model = new TestModel { Property1 = true };
390
helper.
ViewData
.Model = new TestModel { Property1 = true };
391
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
430
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
799
helper.
ViewData
.Model = new TestModel { Property1 = true };
Rendering\HtmlHelperDisplayNameExtensionsTest.cs (1)
60
helper.
ViewData
["value"] = "testvalue";
Rendering\HtmlHelperDisplayTextTest.cs (4)
222
helper.
ViewData
["Name"] = "View data dictionary value";
240
helper.
ViewData
["Name"] = "View data dictionary value";
258
var viewData = helper.
ViewData
;
283
var viewData = helper.
ViewData
;
Rendering\HtmlHelperDropDownListExtensionsTest.cs (14)
33
helper.
ViewData
.ModelState.SetModelValue("Property1", 3, "3");
34
helper.
ViewData
["Property1"] = BasicSelectList;
57
helper.
ViewData
.ModelState.SetModelValue("Property1", 1, "1");
58
helper.
ViewData
["Property1"] = BasicSelectList;
83
helper.
ViewData
.Model = new TestModel { Property2 = "4" };
108
helper.
ViewData
.ModelState.SetModelValue("Property1", 4, "4");
109
helper.
ViewData
["Property1"] = BasicSelectList;
135
helper.
ViewData
.Model = new TestModel { Property2 = "5" };
157
helper.
ViewData
["Property1"] = BasicSelectList;
158
helper.
ViewData
.Model = new TestModel { Property1 = 0 };
183
helper.
ViewData
["Property1"] = BasicSelectList;
184
helper.
ViewData
.Model = new TestModel { Property2 = "5" };
209
helper.
ViewData
.Model = new TestModel { Property3 = new List<string> { "0", "2", "4" } };
235
helper.
ViewData
.Model = new TestModel { Property2 = "5" };
Rendering\HtmlHelperHiddenTest.cs (47)
67
helper.
ViewData
.Model.Property1 = "should-not-be-used";
83
helper.
ViewData
.Model.Property1 = "model-property1-value";
84
helper.
ViewData
["Prefix"] = new HiddenModel { Property1 = "contained-view-data-value" };
100
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
101
helper.
ViewData
.Model.Property1 = "model-property1-value";
102
helper.
ViewData
["Prefix"] = new HiddenModel { Property1 = "contained-view-data-value" };
118
helper.
ViewData
.Model.Property1 = "model-property1-value";
119
helper.
ViewData
["Property1"] = null;
135
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
136
helper.
ViewData
.Model.Property1 = "model-property1-value";
137
helper.
ViewData
["Prefix.Property1"] = null;
153
helper.
ViewData
.Clear();
200
helper.
ViewData
.Model.Property1 = "test-value";
215
helper.
ViewData
.ModelState.Clear();
216
helper.
ViewData
.Model.Property1 = "property-value";
231
helper.
ViewData
.ModelState.Clear();
232
helper.
ViewData
.Model.Property1 = "property-value";
247
helper.
ViewData
.Model.Property1 = "property-value";
263
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
264
helper.
ViewData
.Model.Property1 = "property-value";
294
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
326
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
376
helper.
ViewData
.ModelState.Clear();
377
helper.
ViewData
.ModelState.SetModelValue(
381
helper.
ViewData
.ModelState.SetModelValue(
385
helper.
ViewData
.ModelState.SetModelValue(
407
helper.
ViewData
.ModelState.Clear();
408
helper.
ViewData
.Clear();
409
helper.
ViewData
.Add("Property1", "vdd-without-prefix");
410
helper.
ViewData
.Add("MyPrefix.Property1", "vdd-with-prefix");
411
helper.
ViewData
.Add("MyPrefix$Property1", "vdd-with-iddotreplacement");
588
helper.
ViewData
.Model.Bytes = new byte[] { 23, 43, 53 };
603
helper.
ViewData
.Model.Property1 = "test";
618
helper.
ViewData
.Model.Property1 = "DefaultValue";
633
helper.
ViewData
.ModelState.Clear();
634
helper.
ViewData
.Model.Property1 = "PropertyValue";
649
helper.
ViewData
.Model.Property1 = null;
650
helper.
ViewData
.ModelState.Clear();
682
helper.
ViewData
.Model.Property1 = "propValue";
701
helper.
ViewData
.Model.Property1 = "propValue";
703
helper.
ViewData
.ModelState.Clear();
704
helper.
ViewData
.ModelState.SetModelValue(
708
helper.
ViewData
.ModelState.SetModelValue(
712
helper.
ViewData
.ModelState.SetModelValue(
895
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
913
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
931
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
Rendering\HtmlHelperLabelExtensionsTest.cs (5)
120
helper.
ViewData
.ModelExplorer = modelExplorer;
139
helper.
ViewData
["value"] = "testvalue";
188
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "prefix";
292
helper.
ViewData
.ModelExplorer = provider
295
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = nameof(DefaultTemplatesUtilities.ObjectTemplateModel.Property1);
Rendering\HtmlHelperListBoxExtensionsTest.cs (7)
33
helper.
ViewData
.ModelState.SetModelValue("Property1", 2, "2");
34
helper.
ViewData
["Property1"] = BasicSelectList;
59
helper.
ViewData
.Model = new TestModel { Property3 = new List<string> { "4" } };
84
helper.
ViewData
["Property2"] = new List<string> { "1", "2", "5" };
106
helper.
ViewData
["Property1"] = BasicSelectList;
131
helper.
ViewData
.Model = new TestModel { Property3 = new List<string> { "0", "4", "5" } };
156
helper.
ViewData
["Property3"] = new List<string> { "0", "2" };
Rendering\HtmlHelperNameExtensionsTest.cs (2)
75
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = prefix;
124
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = prefix;
Rendering\HtmlHelperPartialExtensionsTest.cs (6)
417
var viewData = helper.
ViewData
;
446
var viewData = helper.
ViewData
;
477
var viewData = helper.
ViewData
;
506
var viewData = helper.
ViewData
;
535
var viewData = helper.
ViewData
;
566
var viewData = helper.
ViewData
;
Rendering\HtmlHelperPasswordTest.cs (14)
260
helper.
ViewData
.Model.Property1 = "test";
384
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
402
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
420
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
505
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "pre";
507
helper.
ViewData
.ModelState.SetModelValue("pre.Property3[key]", "MProp3Val", "MProp3Val");
508
helper.
ViewData
.ModelState.SetModelValue("pre.Property4.Property5", "MProp5Val", "MProp5Val");
509
helper.
ViewData
.ModelState.SetModelValue("pre.Property4.Property6[0]", "MProp6Val", "MProp6Val");
511
helper.
ViewData
["pre.Property3[key]"] = "VDProp3Val";
512
helper.
ViewData
["pre.Property4.Property5"] = "VDProp5Val";
513
helper.
ViewData
["pre.Property4.Property6"] = "VDProp6Val";
515
helper.
ViewData
.Model.Property3["key"] = "Prop3Val";
516
helper.
ViewData
.Model.Property4.Property5 = "Prop5Val";
517
helper.
ViewData
.Model.Property4.Property6.Add("Prop6Val");
Rendering\HtmlHelperRadioButtonExtensionsTest.cs (3)
55
helper.
ViewData
.Model = new TestModel { Property1 = value };
75
helper.
ViewData
.Model = new TestModel { Property1 = value };
108
helper.
ViewData
.Model = new TestModel { Property2 = true };
Rendering\HtmlHelperSelectTest.cs (13)
354
helper.
ViewData
["Property1"] = selectList;
582
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
623
helper.
ViewData
["Property1"] = selectList;
672
helper.
ViewData
["Property1"] = selectList;
985
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
1089
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Property1";
1121
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Property1";
1145
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Property1";
1165
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Property1";
1186
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Property1";
1216
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Property1";
1237
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Property1";
1259
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Property1";
Rendering\HtmlHelperTest.cs (1)
303
helperToContextualize.
ViewData
);
Rendering\HtmlHelperTextAreaExtensionsTest.cs (5)
22
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
41
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
60
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
79
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
99
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
Rendering\HtmlHelperTextAreaTest.cs (11)
75
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "pre";
77
helper.
ViewData
.Model.Property3["key"] = "Prop3Val";
78
helper.
ViewData
.Model.Property4.Property5 = "Prop5Val";
79
helper.
ViewData
.Model.Property4.Property6.Add("Prop6Val");
122
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "pre";
124
helper.
ViewData
.ModelState.SetModelValue("pre.Property3[key]", "MProp3Val", "MProp3Val");
125
helper.
ViewData
.ModelState.SetModelValue("pre.Property4.Property5", "MProp5Val", "MProp5Val");
126
helper.
ViewData
.ModelState.SetModelValue("pre.Property4.Property6[0]", "MProp6Val", "MProp6Val");
128
helper.
ViewData
.Model.Property3["key"] = "Prop3Val";
129
helper.
ViewData
.Model.Property4.Property5 = "Prop5Val";
130
helper.
ViewData
.Model.Property4.Property6.Add("Prop6Val");
Rendering\HtmlHelperTextBoxExtensionsTest.cs (5)
23
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
41
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
59
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
77
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
95
helper.
ViewData
.Model = new TestModel { Property1 = "propValue" };
Rendering\HtmlHelperTextBoxTest.cs (11)
93
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "pre";
95
helper.
ViewData
.Model.Property3["key"] = "Prop3Val";
96
helper.
ViewData
.Model.Property4.Property5 = "Prop5Val";
97
helper.
ViewData
.Model.Property4.Property6.Add("Prop6Val");
140
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "pre";
142
helper.
ViewData
.ModelState.SetModelValue("pre.Property3[key]", "MProp3Val", "MProp3Val");
143
helper.
ViewData
.ModelState.SetModelValue("pre.Property4.Property5", "MProp5Val", "MProp5Val");
144
helper.
ViewData
.ModelState.SetModelValue("pre.Property4.Property6[0]", "MProp6Val", "MProp6Val");
146
helper.
ViewData
.Model.Property3["key"] = "Prop3Val";
147
helper.
ViewData
.Model.Property4.Property5 = "Prop5Val";
148
helper.
ViewData
.Model.Property4.Property6.Add("Prop6Val");
Rendering\HtmlHelperValidationSummaryTest.cs (45)
209
html.
ViewData
.ModelState.AddModelError(string.Empty, "This is my validation message");
234
html.
ViewData
.TemplateInfo.HtmlFieldPrefix = "this.is.my.prefix";
235
html.
ViewData
.ModelState.AddModelError("this.is.my.prefix", "This is my validation message");
260
html.
ViewData
.ModelState.AddModelError("Property1", "This is my validation message");
283
html.
ViewData
.TemplateInfo.HtmlFieldPrefix = prefix;
284
AddMultipleErrors(html.
ViewData
.ModelState);
310
AddMultipleErrors(html.
ViewData
.ModelState);
311
html.
ViewData
.ModelState.RemoveAll<ValidationModel>(m => m.Property2);
312
html.
ViewData
.ModelState.Remove<ValidationModel>(m => m.Property3);
313
html.
ViewData
.ModelState.Remove<ValidationModel>(m => m.Property3.OrderedProperty2);
314
html.
ViewData
.ModelState.AddModelError("Property2", "New error for Property2.");
347
AddMultipleErrors(html.
ViewData
.ModelState);
348
html.
ViewData
.ModelState.AddModelError("non-existent-property1", "non-existent-error1");
349
html.
ViewData
.ModelState.AddModelError("non.existent.property2", "non-existent-error2");
350
html.
ViewData
.ModelState.AddModelError("non.existent[0].property3", "non-existent-error3");
376
html.
ViewData
.ModelState.AddModelError("Property1", "Property1 error");
377
html.
ViewData
.ModelState.AddModelError("Property2[0].OrderedProperty1", "Property2[0].OrderedProperty1 error");
378
html.
ViewData
.ModelState.AddModelError("Property2[10].Property2", "Property2[10].Property2 error");
379
html.
ViewData
.ModelState.AddModelError("Property2[2].Property3", "Property2[2].Property3 error");
380
html.
ViewData
.ModelState.AddModelError("Property2[0].Property1", "Property2[0].Property1 error");
406
html.
ViewData
.ModelState.AddModelError("[0].OrderedProperty2", "[0].OrderedProperty2 error");
407
html.
ViewData
.ModelState.AddModelError("[0].Property1", "[0].Property1 error");
408
html.
ViewData
.ModelState.AddModelError("[0].OrderedProperty1", "[0].OrderedProperty1 error");
409
html.
ViewData
.ModelState.AddModelError("[2].Property3", "[2].Property3 error");
410
html.
ViewData
.ModelState.AddModelError("[2].OrderedProperty3", "[2].OrderedProperty3 error");
438
html.
ViewData
.ModelState.AddModelError("[0].OrderedProperty2", "[0].OrderedProperty2 error");
439
html.
ViewData
.ModelState.AddModelError("[0].Property1", "[0].Property1 error");
440
html.
ViewData
.ModelState.AddModelError("[0].OrderedProperty1", "[0].OrderedProperty1 error");
441
html.
ViewData
.ModelState.AddModelError("[2].Property3", "[2].Property3 error");
442
html.
ViewData
.ModelState.AddModelError("[2].OrderedProperty3", "[2].OrderedProperty3 error");
443
html.
ViewData
.ModelState.AddModelError("OrderedProperty1", "OrderedProperty1 error");
444
html.
ViewData
.ModelState.AddModelError("OrderedProperty2", "OrderedProperty2 error");
477
AddOrderedErrors(html.
ViewData
.ModelState);
495
helper.
ViewData
.ModelState.AddModelError("Property1", "Error for Property1");
513
helper.
ViewData
.ModelState.AddModelError("Property1", "Error for Property1");
527
helper.
ViewData
.ModelState.AddModelError("Property1", "Error for Property1");
546
helper.
ViewData
.ModelState.AddModelError("Property1", "Error for Property1");
565
helper.
ViewData
.ModelState.AddModelError(string.Empty, "Error for root");
566
helper.
ViewData
.ModelState.AddModelError("Property1", "Error for Property1");
585
helper.
ViewData
.ModelState.AddModelError("Property1", "Error for Property1");
604
helper.
ViewData
.ModelState.AddModelError("Property1", "Error for Property1");
623
helper.
ViewData
.ModelState.AddModelError(string.Empty, "Error for root");
624
helper.
ViewData
.ModelState.AddModelError("Property1", "Error for Property1");
643
helper.
ViewData
.ModelState.AddModelError(string.Empty, "Error for root");
644
helper.
ViewData
.ModelState.AddModelError("Property1", "Error for Property1");
Rendering\HtmlHelperValueTest.cs (14)
35
helper.
ViewData
["Prefix.StringProperty"] = "PrefixedViewDataValue";
36
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
50
helper.
ViewData
["Prefix"] = new { StringProperty = "ContainedViewDataValue" };
64
helper.
ViewData
["Prefix"] = new { StringProperty = "ContainedViewDataValue" };
65
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
79
helper.
ViewData
.Clear();
93
helper.
ViewData
.Clear();
94
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
108
helper.
ViewData
["StringProperty"] = null;
122
helper.
ViewData
["Prefix.StringProperty"] = null;
123
helper.
ViewData
.TemplateInfo.HtmlFieldPrefix = "Prefix";
159
var viewData = helper.
ViewData
;
217
var viewData = helper.
ViewData
;
257
helper.
ViewData
["StringProperty"] = "ViewDataValue";