Skip to content

IHtmlContent not rendering as HtmlString in .Net 4.8? #120

@kendallb

Description

@kendallb

I am in the process of migrating our code slowly over to .net Standard 2.0 for our supplemental libraries, so that we can eventually migrate our huge application stack over to ASP.Net Core and .Net 5. We have been using HtmlTags for years, so I am trying to use the latest version of the library, however for some reason when we render a tag into HTML with ASP.net MVC 4.8, it does not render as HTML. The difference is ASP.net 4.8 is looking for IHtmlString on the class, to determine if it should be rendered as raw HTML, however it ends up not finding that. The HtmlTag class now has IHtmlContent as the interface which is compatible with ASP.net Core, but for some reason the version of ASP.NET MVC we are using is not supporting that.

What is the solution to get this working, so that ASP.net 4.8 will recognize IHtmlContent and render it correctly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions