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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -