Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我以这种方式将 Html 动态添加到服务器端 DIV:
innerHtml = innerHtml + string.Format(@"<div><span>{0}</span><br/>{1}</div><br/>", dr["Date"], dr["State"]);
没关系,问题是 Title 列有普通文本和链接(它是 twitter 状态字段),但链接没有呈现为超链接,而是呈现为普通文本,用户无法单击链接。
我该如何解决这个问题?
谢谢
你的标题栏在哪里?请添加相同的代码。
如果您的链接是 dr["state"] 您的代码将如下所示。
innerHtml = innerHtml + string.Format(@"<div><span>{0}</span><br/><a href='{1}'>Link Name</a></div><br/>", dr["Date"], dr["State"]);
简而言之,<a href='Your link'>Link Name</a>在您的字符串中添加锚标记 ( )。
<a href='Your link'>Link Name</a>