Ho do you pass a line of complex Razor into a helper parameter? This is the best I could come up with, but it can't be right:

@helper Bold(MvcHtmlString fragment){
    <b>@fragment</b>
}

@*
helper containing the fragment, otherwise redundant
*@
@helper Status(){
    @Model.In@:/@Model.Total processed
}

@Bold(new MvcHtmlString(Status().ToHtmlString()))

EDIT: I know Status is better done in the ViewModel in most cases.

Related posts

Recent Viewed