I'm working in ASP.NET MVC 1.0 using MvcContrib FluentHtml version 1.0.
The following code doesn't work because float
is a C# keyword.
<%= this.TextBox(m => m.Name).Styles(float => "left") %>
How do I define the "float" css style using the Styles
method in FluentHtml?
prefix the argument with an @.
<%= this.TextBox(m => m.Name).Styles(@float => "left") %>
When using the argument inside the lambda remember to keep verbatim escape the argument.
@float => @float.ToString()