Tips

@* Razor - wrap the expression with @(... ) *@
@( Html.BuildActionLink("Back", "Index", "Home").
        Data("icon", "arrow-l").
        Data("rel", "back"))

@* Or use a build action overload *@
@Html.BuildActionLink("Back", b => b.ControllerRoute("Home", "Index").
                                     Data("icon", "arrow-l").
                                     Data("rel", "back"))

@* Reuse build actions *@
@{
    Action<Build.Mvc.ITextBoxBuilder> buildAction = b => b.Attr("required", "required").MaxLength(36);
}

@Html.BuildTextBoxFor(m=> m.FirstName, buildAction)
@Html.BuildTextBoxFor(m=> m.LastName, buildAction)

Last edited Mar 5, 2013 at 8:16 PM by grcodemonkey, version 11

Comments

No comments yet.