Convert server side html control to string


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



Copy this code and paste it in your HTML
  1. var sb = new StringBuilder();
  2. var sw = new StringWriter(sb);
  3. var htw = new HtmlTextWriter(sw);
  4. PriceTable.RenderControl(htw); //this holds an Table object
  5. return sb.ToString();

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.