Users Pricing

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 2507 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.


I am a content writter !


1 Answers