Closed wardjc closed 7 years ago
Appears to be New in version 3.3.5.3 of the core FluentBootstrap package.
That was a change in #53 and released in 3.3.5.3 to match up behavior of adding content to an element with what the native Razor controls do. I.e., it'll now automatically HTML escape plain strings. The simple way around this is to use new HtmlString()
:
.SetControlLabel(new HtmlString("SQL Server <span class='badge badge-primary'>Recommended</span>"))
Ah, fair enough mate. Cheers for taking the time.
Hi Dave,
Not sure if you noticed but your above solution does not work for me. The string is still rendered as plain text (without the Bootstrap badge visible). That's with me adding .ToHtmlString() to the end of your solution above.
This is now resolved in the develop branch and will (hopefully) go out with a release later this week. You'll be able to use the new HtmlString()
syntax above for SetControlLabel()
as well as many other extensions.
If I use the below as the parameter for the function it is rendered on the page as below making it difficult to style the items in the label.
.SetControlLabel("SQL Server <span class='badge badge-primary'>Recommended</span>")