如何使用C#或VB.NET,一个带有图例和一些内容的字段集,以编程方式创建,以便生成的标记看起来像这样?
<fieldset><legend>foo</legend>res ipsa loquitur</fieldset>
不按照此处的建议寻找<fieldset>
的替代方案:
How to create HTML fieldset and legend in asp.net code behind?
可以使用ASP.NET HtmlGenericControl 吗?
由于
答案 0 :(得分:1)
Literal l = new Literal();
l.Mode = LiteralMode.PassThrough;
l.Text = "<fieldset><legend>foo</legend>res ipsa loquitur</fieldset>";
this.Controls.Add(l);