razor - Calling TagHelpers from another TagHelper? -
is there way taghelper render taghelper?
example taghelpers;
public class outertaghelper : taghelper { public override void process(taghelpercontext context, taghelperoutput output) { output.tagname = ""; output.content.setcontent("hello <inner></inner>"); } } public class innertaghelper : taghelper { public override void process(taghelpercontext context, taghelperoutput output) { output.tagname = ""; output.content.setcontent("world!"); } }
example view;
<outer></outer>
expected result;
hello world!
i know should use viewcomponent instead, @ possible achieve expected behavior presented above?
@daniel j.g. right, not recommended. technically if ran content through highly customized razor parser , executed content if page - it's wrong approach problem.
Comments
Post a Comment