Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Commit 6dd4e10

Browse files
author
NTaylorMullen
committed
Fixed resources.
1 parent de3fb3e commit 6dd4e10

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

src/Microsoft.AspNet.Mvc.TagHelpers/AnchorTagHelper.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
1616
public class AnchorTagHelper : TagHelper
1717
{
1818
private const string RouteAttributePrefix = "route-";
19+
private const string Href = "href";
1920

2021
[Activate]
2122
private IHtmlGenerator Generator { get; set; }
@@ -59,7 +60,7 @@ public class AnchorTagHelper : TagHelper
5960
public override void Process(TagHelperContext context, TagHelperOutput output)
6061
{
6162
// If there's an "href" on the tag it means it's being used as a normal anchor.
62-
if (output.Attributes.ContainsKey("href"))
63+
if (output.Attributes.ContainsKey(Href))
6364
{
6465
if (Action != null || Controller != null || Route != null)
6566
{
@@ -69,7 +70,8 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
6970
nameof(AnchorTagHelper),
7071
nameof(Action),
7172
nameof(Controller),
72-
nameof(Route)));
73+
nameof(Route),
74+
Href));
7375
}
7476

7577
// User is using the AnchorTagHelper as normal anchor tag, restore any provided attributes.
@@ -111,7 +113,8 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
111113
nameof(AnchorTagHelper),
112114
nameof(Route),
113115
nameof(Action),
114-
nameof(Controller)));
116+
nameof(Controller),
117+
Href));
115118
}
116119
else
117120
{
@@ -128,6 +131,7 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
128131
}
129132
}
130133

134+
// Restores bound HTML attributes when we detect that a user is using the AnchorTagHelper as a normal <a> tag.
131135
private void RestoreBoundHtmlAttributes(TagHelperContext context, TagHelperOutput output)
132136
{
133137
if (Action != null)

src/Microsoft.AspNet.Mvc.TagHelpers/Properties/Resources.Designer.cs

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Microsoft.AspNet.Mvc.TagHelpers/Resources.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120120
<data name="AnchorTagHelper_CannotDetermineHrefOneSpecified" xml:space="preserve">
121-
<value>Cannot determine an href for {0}. {0}s with a specified href must not have a {1}, {2} or {3} attribute.</value>
121+
<value>Cannot determine an {4} for {0}. A {0} with a specified {4] must not have a {1}, {2} or {3} attribute.</value>
122122
</data>
123123
<data name="AnchorTagHelper_CannotDetermineHrefRouteActionOrControllerSpecified" xml:space="preserve">
124-
<value>Cannot determine an href for {0}. {0}s with a specified {1} must not have a {2} or {3} attribute.</value>
124+
<value>Cannot determine an {4} for {0}. A {0} with a specified {1} must not have a {2} or {3} attribute.</value>
125125
</data>
126126
<data name="FormTagHelper_CannotDetermineAction" xml:space="preserve">
127127
<value>Cannot determine an {1} for {0}. A {0} with a URL-based {1} must not have attributes starting with {3} or a {2} attribute.</value>

0 commit comments

Comments
 (0)