How do you write a literal string in a Webmatrix Helper?
I've tried getting the following helper to work...but I'm scratching my head.
@helper SimpleHelper()
{
string message;
message="<b>Hello</b>";
@message
}
The text c开发者_JAVA百科omes out improperly encoded. With the lt; and gt; instead of the html tags.
Neither WriteLiteral(message) or @:message work.
Use the Html.Raw() helper in Razor to display that as an un-encoded string.
Here's the Razor quick-reference that Phil Haack put together recently.
精彩评论