Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 2
    So HTML Helpers are not actually being deprecated, but rather are supplemented by Tag Helpers? Commented Aug 10, 2015 at 2:25
  • 2
    Couldn't have put it better myself! Yes :) Commented Aug 10, 2015 at 2:59
  • is it possible to provide the model (User) from my page, let's say the sub-model of my main model, rather than instantiating it in the ProcessAsync method in tag helper class? Commented Aug 25, 2016 at 7:10
  • This does not work in ASP.NET Core 1.1. I get an error in line where you say partial.WriteTo(writer, _htmlEncoder) because WriteTo expects System.Text.Encodings.Web.HtmlEncoder not Microsoft.Extensions.WebEncoders.IHTMLEncoder. If you comment that out and try to run it - you then get InvalidOperationException: Unable to resolve service for type 'Microsoft.Extensions.WebEncoders.IHtmlEncoder' while attempting to activate 'UserTagHelper'. Commented Nov 19, 2016 at 8:19
  • 2
    This reminds me of the ASP .NET Web Forms days, with the <asp: controls (like asp:TextBox etc) came into play, and you would read one thing in the HTML markup and then get something completely different in the HTML response stream. Bad vibes. Of course I could have it completely wrong. Commented Aug 20, 2018 at 21:59