如何将最终的htmltextwriter字符串添加到面板 [英] how to add final htmltextwriter string to a panel

查看:77
本文介绍了如何将最终的htmltextwriter字符串添加到面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hiii全部

我正在动态创建标签并将其添加到面板中,但是我想将每个标签都放置在另一种方法的下方.应该在每个标签之后添加到面板中.请任何人帮助我,如何添加此< br/>在htmltextwriter的帮助下将标签标记到面板上....

任何帮助....

hiii all

i am creating labels dynamically and adding them to a panel but i want to place every label one below the other means <br/> should be added to the panel after every label... please any one help me, how to add this <br/> tag to the panel with the help of htmltextwriter....

any help plz....

推荐答案

它隐藏在一个鲜为人知的地方,通常被称为文档http://msdn.microsoft.com/en-us/library/system.web.ui.htmltextwriter.write.aspx [ ^ ]
It''s hidden in a little know place commonly refered to as documentation http://msdn.microsoft.com/en-us/library/system.web.ui.htmltextwriter.write.aspx[^]


您可以使用文字< BR>"创建文字控件并在添加每个标签控件后将其添加到面板中.有关示例,请参见下文.

面板"是ASP.NET面板控件ID.

You can create a literal control with text "<BR>" and add it to the panels after each label controls being added.See below for sample.

"panel" is the ASP.NET Panel Control ID.

TextBox txtBox;
            LiteralControl literalControl = new LiteralControl("<BR>");

            txtBox = new TextBox();
            txtBox.Text = "First";
            panel.Controls.Add(txtBox);
            panel.Controls.Add(literalControl);

            txtBox = new TextBox();
            txtBox.Text = "Second";
            panel.Controls.Add(txtBox);
            literalControl = new LiteralControl("<BR>");
            panel.Controls.Add(literalControl);


这篇关于如何将最终的htmltextwriter字符串添加到面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆