-
Notifications
You must be signed in to change notification settings - Fork 80
Microsoft.AspNet.Razor.Runtime.TagHelpers renamed to Microsoft.AspNet.Razor.TagHelpers #89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
For discussion and feedback, please see the related discussion issue aspnet/Razor#583. |
In the RC1 milestone we have also renamed a few The change may also affect HTML helper authors because the For example this trivial tag helper creates a correctly-encoded paragraph containing random quotes e.g. <p><b>It's Friday!
<!!>
</b>
</p> Before i.e. when using Beta 8using System;
using Microsoft.AspNet.Html.Abstractions;
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
namespace TagHelperSample.Web.TagHelpers
{
[HtmlTargetElement("reason", TagStructure = TagStructure.WithoutEndTag)]
public class ReasonTagHelper : TagHelper
{
public override void Process(TagHelperContext context, TagHelperOutput output)
{
var possibleReasons = new[]
{
"It's Friday!",
"I don't like Mondays.",
"There's an <r> in the name of the Month.",
"Just because."
};
var index = new Random().Next(0, possibleReasons.Length);
var innerContent = new TagBuilder("b");
innerContent.InnerHtml
.AppendLineEncoded(possibleReasons[index])
.AppendLine("<!!>");
output.Content.SetContent(innerContent);
output.PostContent.SetContentEncoded(Environment.NewLine);
output.TagMode = TagMode.StartTagAndEndTag;
output.TagName = "p";
}
}
} Afterusing System;
using Microsoft.AspNet.Html.Abstractions;
using Microsoft.AspNet.Mvc.Rendering;
using Microsoft.AspNet.Razor.TagHelpers;
namespace TagHelperSample.Web.TagHelpers
{
[HtmlTargetElement("reason", TagStructure = TagStructure.WithoutEndTag)]
public class ReasonTagHelper : TagHelper
{
public override void Process(TagHelperContext context, TagHelperOutput output)
{
var possibleReasons = new[]
{
"It's Friday!",
"I don't like Mondays.",
"There's an <r> in the name of the Month.",
"Just because."
};
var index = new Random().Next(0, possibleReasons.Length);
var innerContent = new TagBuilder("b");
innerContent.InnerHtml
.AppendHtmlLine(possibleReasons[index])
.AppendLine("<!!>");
output.Content.SetContent(innerContent);
output.PostContent.SetHtmlContent(Environment.NewLine);
output.TagMode = TagMode.StartTagAndEndTag;
output.TagName = "p";
}
}
} See aspnet/Mvc#3225 for details of this portion of the RC1 tag helper changes. As before please discuss the changes in aspnet/Razor#583. |
Updated comment above to correct linked issue. Should be aspnet/Mvc#3225. Also left out the specific changes to
|
On the basis of an API review we've decided to move top level
TagHelper
elements from theMicrosoft.AspNet.Razor.Runtime.TagHelpers
namespace into theMicrosoft.AspNet.Razor.TagHelpers
namespace.Types moved into
Microsoft.AspNet.Razor.TagHelpers
:DefaultTagHelperContent
HtmlAttributeNameAttribute
HtmlAttributeNotBoundAttribute
HtmlTargetElementAttribute
IReadOnlyTagHelperAttribute
ITagHelper
OutputElementHintAttribute
ReadOnlyTagHelperAttributeList
RestrictChildrenAttribute
TagHelper
TagHelperAttribute
TagHelperAttributeList
TagHelperContent
TagHelperContext
TagHelperOutput
The text was updated successfully, but these errors were encountered: