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 2102 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 !

Can you answer this question?


Answer

1 Answers

Liked By