ASP.NET control to render a

后端 未结 4 2090
Happy的楠姐
Happy的楠姐 2021-02-11 14:09

The Label control in ASP.NET seems to render tags, but is there a server control to render HTML within a

?

Sure, I coul

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-11 14:44

    I think you need HtmlGenericControl class. It has a constructor which accepts a string variable which initializes a new instance of the HtmlGenericControl class with the specified tag:

    var div = new HtmlGenericControl("div");
    

    It is also has InnerHtml and InnerText properties (you mentioned this in a comment to the previous answer).

提交回复
热议问题