<script runat = "server">
void Button1_Click(object sender, EventArgs e)
{
Label l1 = new Label();
l1.Text = "Text1";
Controls.Add(l1);
Label l2 = new Label();
l2.Text = "Text2";
Controls.Add(l2);
Label l3 = new Label();
l3.Text = "Text3";
Controls.Add(l3);`
}
</script>
проблемы с Controls.Add
Код:
Данный код выводит "Text1Text2Text3". Как сделать, чтобы выводилось
"Text1
Text2
Text3"
Заранее спасибо
Код:
Label l1 = new Label();
l1.Text = "Text1";
Controls.Add(l1);
Label l2 = new Label();
l2.Text = "Text2";
l2.Top = l1.Bottom;
Controls.Add(l2);
Label l3 = new Label();
l3.Text = "Text3";
l3.Top = l2.Bottom;
Controls.Add(l3);
l1.Text = "Text1";
Controls.Add(l1);
Label l2 = new Label();
l2.Text = "Text2";
l2.Top = l1.Bottom;
Controls.Add(l2);
Label l3 = new Label();
l3.Text = "Text3";
l3.Top = l2.Bottom;
Controls.Add(l3);
помогло вот что: l1.Text = "Text<br>";