rendering HTMLTable control containing ASP .Net form elements into string

A

Aur_Ros

I am trying to get a string that contains the HTML code generated for a
table control, Need help, examples about how to use render method and
string builder, Thanks !!!
 
B

Baski

Where you trying to render this html code ?

Assume you have Web User control there you want to render html control,

override your render method in your Usercontrol and , that even handler will
giver you Htmlwriter as one of the param

use writer.writeline(yourHtmlTablestring);

Note: If you want to create html control define all the heml basic elements
as string

like below

string lblHtml = "<TD nowrap><font size=2 face=Verdana>{0}</font></TD>";
string txtBoxHtml = "<TD nowrap><INPUT id={0} type=text name={0} value={1}
disabled class=input></TD>";



and use string .format method to substitue the value

writer.WriteLine(string.Format(lblHtml,name));

writer.WriteLine(string.Format(txtBoxHtml,"txtBox"+name,val));

Thanks
Baski
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top