Append HTML to a div


/ Published in: C#
Save to your folder(s)

Append html to a div tag (using System.Web.UI.HtmlControls)


Copy this code and paste it in your HTML
  1. HtmlGenericControl p = new HtmlGenericControl("p");
  2. div.Controls.Add(p);
  3.  
  4.  
  5. /****************************
  6. <html>
  7. <head>
  8. </head>
  9. <body>
  10. <div id="elem" runat="server">
  11.  
  12. </div>
  13. </body>
  14. </html>
  15. ****************************/

URL: http://www.devcurry.com/2009/01/dynamically-create-tag-using-server.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.