Get Full HTML from TagBuilder Masked Text Box?

1 posts, 0 answers
  1. JoeThomas
    JoeThomas avatar
    10 posts
    Member since:
    Jun 2019

    Posted 21 Jul 2019 Link to this post

    Anyone know how to go into a Taghelper output, and receive the full HTML markup for Masked TextBox?

    The following was not working:

    output (only gave some of the html)

    output.GetChildContentAsync().GetContent();   (Was Not working !!)


    It Should look like this,

                <span class="k-widget k-maskedtextbox" style="">

                    <input id = "test" name="test" data-role="maskedtextbox" class="k-textbox" autocomplete="off" style="width: 100%;">
                    <span class="k-icon k-i-warning"></span>



    This is our Taghelper Edit Code,

    namespace Test.Web.UI.TagHelpers

        public class TestTextBoxTagHelperGeneral : MaskedTextBoxTagHelper

            public bool Bold { get; set; }

            public int? Height { get; set; }

            public int DefaultHeight { get { return 50; } }

            public IptsTextBoxTagHelperGeneral(IKendoHtmlGenerator generator) : base(generator)

            public override void Process(TagHelperContext context, TagHelperOutput output)
                if (Bold || Height.HasValue)
                    if (Height.HasValue)
                        output.Attributes.Add("style", "height:" + Height + "px");
                        output.Attributes.Add("style", "height:" + DefaultHeight + "px");
                Name = "test";
                base.Process(context, output);

    How do I Get the Final HTML Markup?


Back to Top