I have a helper called EditableArea which provides a user with a runtime-editable div (via JS). EditableArea helper checks if an editable area (not
Here's an example I use to render jQuery Template markup by passing in a template Id and razor-style syntax for the template itself:
public static MvcHtmlString jQueryTmpl(this HtmlHelper htmlHelper,
string templateId, Func
and this would be called with
@Html.jQueryTmpl("templateId", @any type of valid razor syntax here )
Basically just use Func as your parameter and template.Invoke(null) (with arguments if necessary) to render it. Obviously you can skip the call to .Invoke() to avoid rendering the "default" markup.