forum

home / developersection / forums / how to add a div contains asp label from code behind in asp.net

How to Add a div contains asp Label from code behind in asp.net

Anonymous User 2404 07-Jan-2015

I tried to add a div which contains an asp:Label on a button click event.
The following code which I used. CODE

string htmlString = "<div><asp:Label ID=\"l1\" runat=\"server\" Text=\"WELCOME\"></asp:Label></div>";

Panel1.Controls.Add(new LiteralControl(htmlString));

But I am not able to view that particular div.
Please try to solve me this.

Thanks in advance.


Updated on 08-Jan-2015

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By