I am generating scripts in process method of TagHelper class as follows
[TargetElement(\"MyTag\")]
public Class MYClass: TagHelper{
public override
Maybe not the most elegant solution but still working:
Wrap the tag that you want to generate inside a span
and then append some HTML to the InnerHtml
of this span
:
myTag = new TagBuilder("span");
var mymask = htmlGenerator.GenerateTextBox(...);
myTag.InnerHtml.AppendHtml(mymask);
myTag.InnerHtml.AppendHtml(@"<script>...</script>");