1 write to Value
Microsoft.AspNetCore.Razor (1)
TagHelpers\TagHelperAttribute.cs (1)
50
Value
= value;
227 references to Value
Microsoft.AspNetCore.Mvc.Razor (2)
TagHelpers\UrlResolutionTagHelper.cs (2)
162
if (attribute.
Value
is string stringValue)
174
if (attribute.
Value
is IHtmlContent htmlContent)
Microsoft.AspNetCore.Mvc.Razor.Test (18)
RazorPageTest.cs (9)
998
var htmlContent = Assert.IsAssignableFrom<IHtmlContent>(htmlAttribute.
Value
);
1005
htmlContent = Assert.IsAssignableFrom<IHtmlContent>(allAttribute.
Value
);
1043
var htmlContent = Assert.IsAssignableFrom<IHtmlContent>(htmlAttribute.
Value
);
1050
htmlContent = Assert.IsAssignableFrom<IHtmlContent>(allAttribute.
Value
);
1089
var htmlContent = Assert.IsAssignableFrom<IHtmlContent>(htmlAttribute.
Value
);
1096
htmlContent = Assert.IsAssignableFrom<IHtmlContent>(allAttribute.
Value
);
1131
Assert.Equal(expectedValue, (string)attribute.
Value
, StringComparer.Ordinal);
1159
Assert.Equal("someattr", (string)htmlAttribute.
Value
, StringComparer.Ordinal);
1164
Assert.Equal("someattr", (string)allAttribute.
Value
, StringComparer.Ordinal);
src\Shared\Razor\CaseSensitiveBoundAttributeComparer.cs (2)
32
string.Equals(GetString(attributeX.
Value
), GetString(attributeY.
Value
)));
TagHelpers\UrlResolutionTagHelperTest.cs (7)
89
var attributeValue = Assert.IsType<string>(attribute.
Value
);
131
var attributeValue = Assert.IsType<string>(attribute.
Value
);
191
var htmlContent = Assert.IsAssignableFrom<IHtmlContent>(attribute.
Value
);
249
var attributeValue = Assert.IsType<string>(attribute.
Value
);
305
var attributeValue = Assert.IsType<HtmlString>(attribute.
Value
);
336
Assert.True(Assert.IsType<bool>(attribute.
Value
));
431
var attributeValue = Assert.IsType<string>(attribute.
Value
);
Microsoft.AspNetCore.Mvc.TagHelpers (11)
AttributeMatcher.cs (1)
68
if (attribute.
Value
is string valueAsString && string.IsNullOrEmpty(valueAsString))
FormTagHelper.cs (1)
189
switch (actionAttribute.
Value
)
ImageTagHelper.cs (1)
125
Src = output.Attributes[SrcAttributeName].
Value
as string;
InputTagHelper.cs (1)
349
if (formAttribute.
Value
is string formAttributeString)
LinkTagHelper.cs (3)
265
Href = output.Attributes[HrefAttributeName]?.
Value
as string;
406
relAttribute.
Value
== null)
411
var attributeValue = relAttribute.
Value
;
ScriptTagHelper.cs (1)
279
Src = output.Attributes[SrcAttributeName]?.
Value
as string;
TagHelperOutputExtensions.cs (3)
103
new ClassAttributeHtmlContent(classAttribute.
Value
, attribute.Value),
262
switch (classAttribute.
Value
)
278
extractedClassValue = htmlEncoder.Encode(classAttribute.
Value
?.ToString());
Microsoft.AspNetCore.Mvc.TagHelpers.Test (82)
AnchorTagHelperTest.cs (2)
80
Assert.Equal("myanchor", attribute.
Value
);
82
Assert.Equal("home/index", attribute.
Value
);
FormActionTagHelperTest.cs (8)
74
Assert.Equal("my-id", attribute.
Value
as string, StringComparer.Ordinal);
79
Assert.Equal("home/index/value", attribute.
Value
as string, StringComparer.Ordinal);
148
Assert.Equal("my-id", attribute.
Value
as string, StringComparer.Ordinal);
153
Assert.Equal("routine/value", attribute.
Value
as string, StringComparer.Ordinal);
250
Assert.Equal("home/index", attribute.
Value
);
308
Assert.Equal("home/index", attribute.
Value
);
381
Assert.Equal("admin/dashboard/index", attribute.
Value
);
434
Assert.Equal("admin/dashboard/index", attribute.
Value
);
FormTagHelperTest.cs (10)
116
Assert.Equal("post", attribute.
Value
);
118
Assert.Equal("home/index", attribute.
Value
);
170
Assert.Equal("post", attribute.
Value
);
172
Assert.Equal("/home/index", attribute.
Value
);
228
Assert.Equal(HtmlString.Empty, attribute.
Value
);
286
Assert.Equal(string.Empty, attribute.
Value
);
358
Assert.Equal("myform", attribute.
Value
);
360
Assert.Equal("post", attribute.
Value
);
362
Assert.Equal("home/index", attribute.
Value
);
620
Assert.Equal("home/index#test", attribute.
Value
);
ImageTagHelperTest.cs (7)
77
(string)output.Attributes["src"].
Value
,
127
Assert.Equal(expectedAttribute.
Value
.ToString(), actualAttribute.
Value
.ToString());
161
Assert.Equal("/images/test-image.png?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", srcAttribute.
Value
);
213
Assert.Equal(expectedValue, srcAttribute.
Value
);
256
Assert.Equal("/images/test-image.png", srcAttribute.
Value
);
288
Assert.Equal("/bar/images/image.jpg?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", srcAttribute.
Value
);
LinkTagHelperTest.cs (13)
75
(string)output.Attributes["href"].
Value
,
600
Assert.Equal("/css/site.css", output.Attributes["href"].
Value
);
641
Assert.Equal("/css/site.css", output.Attributes["href"].
Value
);
694
Assert.Equal("/css/site.css", output.Attributes["href"].
Value
);
725
Assert.Equal("/css/site.css?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", output.Attributes["href"].
Value
);
759
Assert.Equal(expected, output.Attributes["href"].
Value
);
801
Assert.Equal("/approot/css/site.fingerprint.css", output.Attributes["href"].
Value
);
831
Assert.Equal("/bar/css/site.css?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", output.Attributes["href"].
Value
);
884
Assert.Equal("/css/site.css?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", output.Attributes["href"].
Value
);
939
Assert.Equal("/css/site.fingerprint.css", output.Attributes["href"].
Value
);
1009
Assert.Equal("/css/site.css?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", output.Attributes["href"].
Value
);
1049
Assert.Equal("/css/site.css?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", output.Attributes["href"].
Value
);
1091
Assert.Equal("/css/site.fingerprint.css", output.Attributes["href"].
Value
);
ScriptTagHelperTest.cs (14)
74
(string)output.Attributes["src"].
Value
,
559
Assert.Equal("/js/site.js", output.Attributes["src"].
Value
);
612
Assert.Equal("/js/site.js", output.Attributes["src"].
Value
);
638
Assert.Equal("/js/site.js?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", output.Attributes["src"].
Value
);
668
Assert.Equal(expected, output.Attributes["src"].
Value
);
706
Assert.Equal("/approot/js/site.fingerprint.js", output.Attributes["src"].
Value
);
833
Assert.Equal("/bar/js/site.js?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", output.Attributes["src"].
Value
);
861
Assert.Equal("/js/site.js?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", output.Attributes["src"].
Value
);
893
Assert.Equal("/js/site.fingerprint.js", output.Attributes["src"].
Value
);
946
Assert.Equal("/js/site.js?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", output.Attributes["src"].
Value
);
984
Assert.Equal("/js/site.js?v=f4OxZX_x_FO5LcGBSKHWXfwtSx-j1ncoSt3SABJtkGk", output.Attributes["src"].
Value
);
1023
Assert.Equal("/js/site.fingerprint.js", output.Attributes["src"].
Value
);
1062
Assert.Equal("module", output.Attributes["type"].
Value
);
1063
Assert.Equal("/approot/js/site.fingerprint.js", output.Attributes["src"].
Value
);
SelectTagHelperTest.cs (2)
776
Assert.Equal(expectedAttributeValue, attribute.
Value
);
825
Assert.Equal(expectedAttributeValue, attribute.
Value
);
src\Shared\Razor\CaseSensitiveBoundAttributeComparer.cs (2)
32
string.Equals(GetString(attributeX.
Value
), GetString(attributeY.
Value
)));
TagHelperOutputExtensionsTest.cs (8)
915
Assert.Equal(expectedAttribute1.
Value
, attribute.
Value
);
917
Assert.Equal(expectedAttribute2.
Value
, attribute.
Value
);
964
Assert.Equal(expectedOutputAttribute.
Value
, attribute.
Value
);
966
Assert.Equal(expectedBuilderAttribute.
Value
, attribute.
Value
);
TextAreaTagHelperTest.cs (1)
232
Assert.Equal(expectedAttributeValue, attribute.
Value
);
ValidationMessageTagHelperTest.cs (12)
75
Assert.Equal("myvalidationmessage", attribute.
Value
);
77
Assert.Equal("field-validation-valid", attribute.
Value
);
79
Assert.Equal("Name", attribute.
Value
);
81
Assert.Equal("true", attribute.
Value
);
181
Assert.Equal(expectedAttributeValue, attribute.
Value
);
186
Assert.Equal("field-validation-valid", attribute.
Value
);
191
Assert.Equal("true", attribute.
Value
);
230
Assert.Equal(expectedAttributeValue, attribute.
Value
);
348
Assert.Equal("bar", attribute.
Value
);
350
Assert.Equal("world", attribute.
Value
);
410
Assert.Equal("bar", attribute.
Value
);
412
Assert.Equal("world", attribute.
Value
);
ValidationSummaryTagHelperTest.cs (3)
447
Assert.Equal("something", attribute.
Value
);
452
Assert.Equal("bar", attribute.
Value
);
457
Assert.Equal("world", attribute.
Value
);
Microsoft.AspNetCore.Razor (21)
TagHelpers\TagHelperAttribute.cs (19)
16
/// <see cref="ValueStyle"/> is set to <see cref="HtmlAttributeValueStyle.Minimized"/> and <see cref="
Value
"/> to
30
/// <param name="value">The <see cref="
Value
"/> of the attribute.</param>
41
/// <param name="value">The <see cref="
Value
"/> of the new instance.</param>
77
(ValueStyle == HtmlAttributeValueStyle.Minimized || Equals(
Value
, other.
Value
));
99
var htmlContent =
Value
as IHtmlContent;
104
else if (
Value
!= null)
106
encoder.Encode(writer,
Value
.ToString());
137
if ((valueAsString =
Value
as string) != null)
141
else if ((valueAsHtmlContainer =
Value
as IHtmlContentContainer) != null)
145
else if ((valueAsHtmlContent =
Value
as IHtmlContent) != null)
149
else if (
Value
!= null)
151
destination.Append(
Value
.ToString());
182
if ((valueAsString =
Value
as string) != null)
186
else if ((valueAsHtmlContainer =
Value
as IHtmlContentContainer) != null)
190
else if ((valueAsHtmlContent =
Value
as IHtmlContent) != null)
194
else if (
Value
!= null)
196
destination.Append(
Value
.ToString());
222
hashCode.Add(
Value
);
TagHelpers\TagHelperAttributeList.cs (2)
68
/// The <see cref="TagHelperAttribute.
Value
"/> to set.
128
/// <param name="value">The <see cref="TagHelperAttribute.
Value
"/> of the attribute to add.</param>
Microsoft.AspNetCore.Razor.Runtime.Test (6)
Runtime\TagHelpers\TagHelperRunnerTest.cs (4)
167
Assert.Equal("somethingelse", output.Attributes["class"].
Value
);
168
Assert.Equal("world", output.Attributes["hello"].
Value
);
186
Assert.Equal("True", executionContext.Output.Attributes["foo"].
Value
);
241
output.Attributes.Add("foo", context.AllAttributes["foo"].
Value
.ToString());
src\Shared\Razor\CaseSensitiveBoundAttributeComparer.cs (2)
32
string.Equals(GetString(attributeX.
Value
), GetString(attributeY.
Value
)));
Microsoft.AspNetCore.Razor.Test (86)
src\Shared\Razor\CaseSensitiveBoundAttributeComparer.cs (2)
32
string.Equals(GetString(attributeX.
Value
), GetString(attributeY.
Value
)));
TagHelpers\ReadOnlyTagHelperAttributeListTest.cs (62)
221
{ new[] { A }, new TagHelperAttribute(A.Name, A.
Value
), true },
222
{ new[] { A }, new TagHelperAttribute("aname", A.
Value
), true },
224
{ new[] { A, B }, new TagHelperAttribute(A.Name, A.
Value
), true },
225
{ new[] { A, B }, new TagHelperAttribute("AnaMe", A.
Value
), true },
227
{ new[] { A, B }, new TagHelperAttribute(B.Name, B.
Value
), true },
228
{ new[] { A, B }, new TagHelperAttribute("BNAME", B.
Value
), true },
230
{ new[] { A, B, C }, new TagHelperAttribute(B.Name, B.
Value
), true },
231
{ new[] { A, B, C }, new TagHelperAttribute("bname", B.
Value
), true },
233
{ new[] { A, B, C }, new TagHelperAttribute(C.Name, C.
Value
), true },
234
{ new[] { A, B, C }, new TagHelperAttribute("CNAme", C.
Value
), true },
251
{ new[] { A, B, A2, C }, new TagHelperAttribute(A.Name, A.
Value
), true },
252
{ new[] { A, B, A2, C }, new TagHelperAttribute("aname", A.
Value
), true },
254
{ new[] { B, A2, A }, new TagHelperAttribute(A.Name, A.
Value
), true },
255
{ new[] { B, A2, A }, new TagHelperAttribute("AnAME", A2.
Value
), true },
257
{ new[] { B, A2, A, C }, new TagHelperAttribute(A.Name, A.
Value
), true },
258
{ new[] { B, A2, A, C }, new TagHelperAttribute("ANAME", A.
Value
), true },
260
{ new[] { A, A3 }, new TagHelperAttribute(A.Name, A.
Value
), true },
261
{ new[] { A, A3 }, new TagHelperAttribute("ANamE", A.
Value
), true },
263
{ new[] { A3, A }, new TagHelperAttribute(A3.Name, A3.
Value
), true },
264
{ new[] { A3, A }, new TagHelperAttribute("anamE", A3.
Value
), true },
266
{ new[] { A, A2, A3 }, new TagHelperAttribute(A.Name, A.
Value
), true },
267
{ new[] { A, A2, A3 }, new TagHelperAttribute("ANAme", A.
Value
), true },
269
{ new[] { C, B, A3, A }, new TagHelperAttribute(A3.Name, A3.
Value
), true },
270
{ new[] { C, B, A3, A }, new TagHelperAttribute("aname", A3.
Value
), true },
272
{ new[] { A, B, A2, C }, new TagHelperAttribute(A.Name, A3.
Value
), false },
275
{ new[] { B, A2, A }, new TagHelperAttribute(A.Name, A3.
Value
), false },
278
{ new[] { B, A2, A, C }, new TagHelperAttribute(A.Name, A3.
Value
), false },
281
{ new[] { A, A3 }, new TagHelperAttribute(A.Name, A2.
Value
), false },
284
{ new[] { A3, A }, new TagHelperAttribute(A3.Name, A2.
Value
), false },
287
{ new[] { A, A2, A3 }, new TagHelperAttribute(A.Name, B.
Value
), false },
290
{ new[] { C, B, A3, A }, new TagHelperAttribute(A3.Name, A2.
Value
), false },
405
{ new[] { A }, new TagHelperAttribute(A.Name, A.
Value
), 0 },
406
{ new[] { A }, new TagHelperAttribute("aname", A.
Value
), 0 },
408
{ new[] { A, B }, new TagHelperAttribute(A.Name, A.
Value
), 0 },
409
{ new[] { A, B }, new TagHelperAttribute("AnaMe", A.
Value
), 0 },
411
{ new[] { A, B }, new TagHelperAttribute(B.Name, B.
Value
), 1 },
412
{ new[] { A, B }, new TagHelperAttribute("BNAME", B.
Value
), 1 },
414
{ new[] { A, B, C }, new TagHelperAttribute(B.Name, B.
Value
), 1 },
415
{ new[] { A, B, C }, new TagHelperAttribute("bname", B.
Value
), 1 },
417
{ new[] { A, B, C }, new TagHelperAttribute(C.Name, C.
Value
), 2 },
418
{ new[] { A, B, C }, new TagHelperAttribute("CNAme", C.
Value
), 2 },
435
{ new[] { A, B, A2, C }, new TagHelperAttribute(A.Name, A.
Value
), 0 },
436
{ new[] { A, B, A2, C }, new TagHelperAttribute("aname", A.
Value
), 0 },
438
{ new[] { B, A2, A }, new TagHelperAttribute(A.Name, A.
Value
), 2 },
439
{ new[] { B, A2, A }, new TagHelperAttribute("AnAME", A2.
Value
), 1 },
441
{ new[] { B, A2, A, C }, new TagHelperAttribute(A.Name, A.
Value
), 2 },
442
{ new[] { B, A2, A, C }, new TagHelperAttribute("ANAME", A.
Value
), 2 },
444
{ new[] { A, A3 }, new TagHelperAttribute(A.Name, A.
Value
), 0 },
445
{ new[] { A, A3 }, new TagHelperAttribute("ANamE", A.
Value
), 0 },
447
{ new[] { A3, A }, new TagHelperAttribute(A3.Name, A3.
Value
), 0 },
448
{ new[] { A3, A }, new TagHelperAttribute("anamE", A3.
Value
), 0 },
450
{ new[] { A, A2, A3 }, new TagHelperAttribute(A.Name, A.
Value
), 0 },
451
{ new[] { A, A2, A3 }, new TagHelperAttribute("ANAme", A.
Value
), 0 },
453
{ new[] { C, B, A3, A }, new TagHelperAttribute(A3.Name, A3.
Value
), 2 },
454
{ new[] { C, B, A3, A }, new TagHelperAttribute("aname", A3.
Value
), 2 },
456
{ new[] { A, B, A2, C }, new TagHelperAttribute(A.Name, A3.
Value
), -1 },
459
{ new[] { B, A2, A }, new TagHelperAttribute(A.Name, A3.
Value
), -1 },
462
{ new[] { B, A2, A, C }, new TagHelperAttribute(A.Name, A3.
Value
), -1 },
465
{ new[] { A, A3 }, new TagHelperAttribute(A.Name, A2.
Value
), -1 },
468
{ new[] { A3, A }, new TagHelperAttribute(A3.Name, A2.
Value
), -1 },
471
{ new[] { A, A2, A3 }, new TagHelperAttribute(A.Name, B.
Value
), -1 },
474
{ new[] { C, B, A3, A }, new TagHelperAttribute(A3.Name, A2.
Value
), -1 },
TagHelpers\TagHelperAttributeListTest.cs (22)
152
{ new[] { A }, "AName", ASet1.
Value
, new[] { ASet1 } },
153
{ new[] { A }, "AnAmE", ASet2.
Value
, new[] { ASet2 } },
154
{ new[] { A, B }, "AName", ASet1.
Value
, new[] { ASet1, B } },
155
{ new[] { A, B }, "AnAmE", ASet2.
Value
, new[] { ASet2, B } },
156
{ new[] { A, B }, "BName", BSet1.
Value
, new[] { A, BSet1 } },
157
{ new[] { A, B }, "BnAmE", BSet2.
Value
, new[] { A, BSet2 } },
158
{ new[] { A, B, C }, "BName", BSet1.
Value
, new[] { A, BSet1, C } },
159
{ new[] { A, B, C }, "BnAmE", BSet2.
Value
, new[] { A, BSet2, C } },
160
{ new[] { A, B, C }, "CName", CSet1.
Value
, new[] { A, B, CSet1 } },
161
{ new[] { A, B, C }, "cnamE", CSet2.
Value
, new[] { A, B, CSet2 } },
162
{ Enumerable.Empty<TagHelperAttribute>(), "Set", set.
Value
, new[] { set } },
163
{ new[] { B }, "Set", set.
Value
, new[] { B, set } },
164
{ new[] { A, B }, "Set", set.
Value
, new[] { A, B, set } },
167
{ new[] { A, B, A2, C }, "AName", ASet1.
Value
, new[] { ASet1, B, C } },
168
{ new[] { A, B, A2, C }, "AnAmE", ASet2.
Value
, new[] { ASet2, B, C } },
169
{ new[] { B, A2, A }, "AName", ASet1.
Value
, new[] { B, ASet1 } },
170
{ new[] { B, A2, A, C }, "AnAmE", ASet2.
Value
, new[] { B, ASet2, C } },
171
{ new[] { A, A3 }, "aname", A3Set.
Value
, new[] { A3Set } },
172
{ new[] { A3, A }, "aname", A3Set.
Value
, new[] { A3Set } },
173
{ new[] { A, A2, A3 }, "AName", ASet1.
Value
, new[] { ASet1 } },
174
{ new[] { A, A2, A3 }, "BName", BSet1.
Value
, new[] { A, A2, A3, BSet1 } },
175
{ new[] { A, A2, A3, B, C }, "Set", set.
Value
, new[] { A, A2, A3, B, C, set } },
TagHelpersWebSite (1)
TagHelpers\ATagHelper.cs (1)
35
attribute => attribute.
Value
);