c# - Razor declarative helper passing model as parameter -
how can pass model custom html helper parameter?
currently have following file
@helper labelfor(string label, string hint) { <label for="@label">@label</label> <span class="mif-info" data-role="hint" data-hint-background="bg-blue" data-hint-color="fg-white" data-hint-mode="1" data-hint-position="top" data-hint="@hint"></span> }
which called with
@myhelpers.labelfor(html.displaynamefor(model => model.title).tostring(), "description")
how can simplify
@myhelpers.labelfor(model => model.title, "description")
i guess, can achieve same using mvc displaytemplates. did try path?
Comments
Post a Comment