how can make a dynamic table in asp.net

Posted by Bhuwan87rawat under ASP.NET on 12/6/2012 | Points: 10 | Views : 1078 | Status : [Member] | Replies : 4
hello sir
in my application i fetch all recode in a grid view but i want to make a dynamic table i fetch recode
this is possible in asp.net if possible then how?




Responses

Posted by: Pavanandey on: 12/6/2012 [Member] Bronze | Points: 25

Up
0
Down
you can create an html table in asp.net code by adding <table>, tr, td tags dynamically and then add the same to the web page once added all the date to the table

Thanks
Pavan Kumar
Mark Answer if this fits the need

Bhuwan87rawat, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ranjeet_8 on: 12/6/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
Add below Div on ur ASPX design page.
 

<div id="HtmlDesign" runat="server" >
</div>

Add below code on ur Page Load / Button Click event in C#.
 

System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("<table border='1'>");
sb.Append("<tr><td>Sno.</td><td>ECode</td><td>Name</td></tr>");
sb.Append("<tr><td>1</td><td>001</td><td>Aashi</td></tr>");
sb.Append("<tr><td>2</td><td>002</td><td>Ranjan</td></tr>");
sb.Append("<tr><td>3</td><td>003</td><td>Arun</td></tr>");
sb.Append("</table>");
HtmlDesign.InnerHtml = sb.ToString();


Bhuwan87rawat, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ranjeet_8 on: 12/6/2012 [Member] [MVP] Gold | Points: 25

Up
0
Down
Hi @Bhuwan87rawat
plz Mark As Answer if post will helps you.

Bhuwan87rawat, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sandhyab on: 12/11/2012 [Member] Starter | Points: 25

Up
0
Down
Once refer the below link
http://www.codeproject.com/Articles/169373/Dynamic-Table-in-Asp-Net-using-C

Thanks & Regards

Bhuwan87rawat, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response