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.
我在 asp.net 中有一个带有占位符标记的 HTML 表,例如 #value1# 和 #value2#。标签当前是<td>元素中的文本。
<td>
在 C# 中,我想用我从代码计算的值替换这些文本。从 C# 替换 HTML 标签的最佳方法是什么?
制作占位符Literal控件并将值输出到Text属性:
Literal
Text
<asp:Literal runat="server" ID="PlaceHolder1" /> PlaceHolder1.Text = "content that would replace placeholder text";