簡體   English   中英

如何在后面的代碼中使用html標簽?

[英]How to use html tag in code behind?

我需要在代碼后面使用諸如<sup></sup>類的html標簽,而無需在aspx頁面中聲明任何內容。

到目前為止,我已經在下面嘗試過:

string s = HtmlTextWriterTag.Sup.ToString("1");

試試這個:

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

從MSDN

您可以使用HTML gerneric contorls

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM