如何在代码中使用html标签?

时间:2015-05-21 08:41:02

标签: c# html asp.net

我需要在后面的代码中使用Database sharding等html标记,而不在aspx页面中声明任何内容。

到目前为止,我在下面尝试过:

<sup></sup>

2 个答案:

答案 0 :(得分:2)

试试这个:

var strVariable = "This is a string object";
strVariable = strVariable.sup();

From MSDN

答案 1 :(得分:0)

你可以使用html gerneric contorls

HtmlGenericControl sub= new HtmlGenericControl("sub"); sub.Attributes.Add("class", "your-class"); sub.ID = "subId"; sub.ClientIDMode = ClientIDMode.Static;

相关问题