【发布时间】:2013-12-23 12:20:26
【问题描述】:
当我知道使用此代码动态创建的 div 的 ID 时,如何执行操作(例如更改文本):
Stringbuilder sb = new Strinbuilder();
sb.AppendLine("<div id='example'>I want to change this text</div>");
//Examples using a literal, placeholder or a lable:
litExample.Text = sb.ToString();
phExample.Text = sb.ToString();
lblExample.Text = sb.ToString();
//Call id example and change "I want to change this text" , to something else.
//How do I do this?
提前致谢。
【问题讨论】:
-
基本上 - 你不会那样做。您可以创建一个 HTMLGenreric 控件并将其添加到您的页面中,这可能会执行您想要执行的操作:msdn.microsoft.com/en-us/library/…。但是您并没有真正提供足够的信息来提供更多建议/帮助。
标签: c# asp.net html dynamic stringbuilder