6 writes to Attributes
Microsoft.AspNetCore.Mvc.TagHelpers.Test (6)
InputTagHelperTest.cs (5)
860
Attributes
=
1292
Attributes
=
1458
Attributes
=
1552
Attributes
=
1670
Attributes
=
TestableHtmlGenerator.cs (1)
98
Attributes
=
73 references to Attributes
Microsoft.AspNetCore.Mvc.TagHelpers (4)
InputTagHelper.cs (2)
256
if (tagBuilder.
Attributes
.TryGetValue("name", out var fullName) &&
336
if (!hiddenForCheckboxTag.
Attributes
.ContainsKey("name") &&
TagHelperOutputExtensions.cs (2)
78
/// Merges the given <paramref name="tagBuilder"/>'s <see cref="TagBuilder.
Attributes
"/> into the
90
foreach (var attribute in tagBuilder.
Attributes
)
Microsoft.AspNetCore.Mvc.TagHelpers.Test (17)
InputTagHelperTest.cs (2)
875
.Callback(() => viewContext.FormContext.InvariantField(tagBuilder.
Attributes
["name"], usesInvariantFormatting))
879
? $"<input name=\"__Invariant\" type=\"hidden\" value=\"{tagBuilder.
Attributes
["name"]}\" />"
TagHelperOutputExtensionsTest.cs (8)
782
tagBuilder.
Attributes
.Add(attr.Key, attr.Value);
808
tagBuilder.
Attributes
.Add("type", "hello");
830
tagBuilder.
Attributes
.Add("class", "btn");
858
tagBuilder.
Attributes
.Add(updateName, "btn");
883
tagBuilder.
Attributes
.Add("visible", "val < 3");
906
tagBuilder.
Attributes
.Add("class", "btn");
907
tagBuilder.
Attributes
.Add("class2", "btn");
956
tagBuilder.
Attributes
.Add("for", "hello");
ValidationMessageTagHelperTest.cs (4)
302
tagBuilder.
Attributes
.Add("data-foo", "bar");
303
tagBuilder.
Attributes
.Add("data-hello", "world");
365
tagBuilder.
Attributes
.Add("data-foo", "bar");
366
tagBuilder.
Attributes
.Add("data-hello", "world");
ValidationSummaryTagHelperTest.cs (3)
398
tagBuilder.
Attributes
.Add("anything", "something");
399
tagBuilder.
Attributes
.Add("data-foo", "bar");
400
tagBuilder.
Attributes
.Add("data-hello", "world");
Microsoft.AspNetCore.Mvc.ViewFeatures (30)
DefaultDisplayTemplates.cs (4)
35
inputTag.
Attributes
["disabled"] = "disabled";
36
inputTag.
Attributes
["type"] = "checkbox";
39
inputTag.
Attributes
["checked"] = "checked";
51
selectTag.
Attributes
["disabled"] = "disabled";
DefaultHtmlGenerator.cs (6)
390
tagBuilder.
Attributes
.Add("for", idString);
1048
tagBuilder.
Attributes
["value"] = item.Value;
1053
tagBuilder.
Attributes
["selected"] = "selected";
1058
tagBuilder.
Attributes
["disabled"] = "disabled";
1173
var suppliedTypeString = tagBuilder.
Attributes
["type"];
1380
tagBuilder.
Attributes
);
DefaultHtmlGeneratorExtensions.cs (2)
40
tagBuilder.
Attributes
["action"] += "#" + fragment;
71
tagBuilder.
Attributes
["action"] += "#" + fragment;
HtmlHelper.cs (5)
743
if (!hiddenForCheckbox.
Attributes
.ContainsKey("name") &&
744
checkbox.
Attributes
.TryGetValue("name", out var name))
1063
if (tagBuilder.
Attributes
.Count == 0)
1068
else if (tagBuilder.
Attributes
.Count == 1 &&
1069
tagBuilder.
Attributes
.TryGetValue("for", out var forAttribute) &&
NameAndIdProvider.cs (3)
75
/// nothing if <see cref="TagBuilder.
Attributes
"/> already contains an "id" attribute or the
106
if (!tagBuilder.
Attributes
.ContainsKey("id"))
114
tagBuilder.
Attributes
["id"] = sanitizedId;
Rendering\TagBuilder.cs (10)
57
Attributes
.Add(tag);
127
if (
Attributes
.TryGetValue("class", out var currentValue))
129
Attributes
["class"] = currentValue + " " + value;
133
Attributes
["class"] = value;
201
/// nothing if <see cref="
Attributes
"/> already contains an "id" attribute or the <paramref name="name"/>
221
if (!
Attributes
.ContainsKey("id"))
229
Attributes
["id"] = sanitizedId;
239
foreach (var attribute in
Attributes
)
281
if (replaceExisting || !
Attributes
.ContainsKey(key))
283
Attributes
[key] = value;
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (22)
DefaultHtmlGeneratorTest.cs (10)
132
var attribute = Assert.Single(tagBuilder.
Attributes
, a => a.Key == "name");
186
var attribute = Assert.Single(tagBuilder.
Attributes
, a => a.Key == "name");
210
var attribute = Assert.Single(tagBuilder.
Attributes
, a => a.Key == "maxlength");
234
var attribute = Assert.Single(tagBuilder.
Attributes
, a => a.Key == "maxlength");
258
var attribute = Assert.Single(tagBuilder.
Attributes
, a => a.Key == "maxlength");
280
var attribute = Assert.Single(tagBuilder.
Attributes
, a => a.Key == "maxlength");
302
Assert.DoesNotContain(tagBuilder.
Attributes
, a => a.Key == "maxlength");
326
var attribute = Assert.Single(tagBuilder.
Attributes
, a => a.Key == "maxlength");
433
Assert.DoesNotContain(tagBuilder.
Attributes
, a => a.Key == "maxlength");
486
var attribute = Assert.Single(tagBuilder.
Attributes
, a => a.Key == "data-valmsg-for");
Rendering\TagBuilderTest.cs (12)
31
tagBuilder.
Attributes
.Add("Hello", "World");
37
var attribute = Assert.Single(tagBuilder.
Attributes
);
46
tagBuilder.
Attributes
.Add("ClaSs", "btn");
52
var attribute = Assert.Single(tagBuilder.
Attributes
);
61
tagBuilder.
Attributes
.Add("ID", "something");
67
var attribute = Assert.Single(tagBuilder.
Attributes
);
78
tagBuilder.
Attributes
.Add("ID", string.Empty);
153
tagBuilder.
Attributes
.Add(attributeKey, attributeValue);
320
Assert.NotSame(originalTagBuilder.
Attributes
, clonedTagBuilder.
Attributes
);
321
Assert.Equal(originalTagBuilder.
Attributes
, clonedTagBuilder.
Attributes
);