Reputation: 5035
I am using Phil Haack's RenderSection helper to define layout Sections with default content. It all works nicely but in one case the default content is contained in an HtmlString. I had to wrap the variable expression in a span like this:
@this.RenderSection("aSectionName",
@<span>@anHtmlStringVariable</span>
)
to get the Razor engine to interpret the HtmlString correctly. While it is unlikely that adding a span is going to cause problems for my layout it seems like I shouldn't have to wrap it like that. Is there a way around this?
Upvotes: 0
Views: 438