Surendra Sharma

Surendra Sharma

Search This Blog

Thursday, May 13, 2010

Create HTML Table in ASP.NET


Table one Table & say Run as a server control. Its Id is 
tblIntangiblesInner





public

void FillIntangibleTable()


            {


                 ArrayList arrList = null;


                 arrList = (ArrayList)LoadAllIntangibles();


                 foreach (object
item in arrList)


                 {


                       HtmlTableRow theRow = new HtmlTableRow();


                       HtmlTableCell []theCell = new
HtmlTableCell[2];


                       theCell[0] = new HtmlTableCell();


                       theCell[1] = new HtmlTableCell();


                       theCell[0].Width = "5%";


                       theCell[1].Width = "95%";


                       theCell[0].InnerHtml = " ";


                       theCell[1].InnerHtml = "<a
href=default.aspx?GSIN="
+item.ToString()+">"
+ item.ToString() + "</a>";


                       theRow.Cells.Add(theCell[0]);


                       theRow.Cells.Add(theCell[1]);


                       tblIntangiblesInner.Rows.Add(theRow);


                 }



           }






public

ArrayList LoadAllIntangibles()


            {


                 System.Collections.ArrayList obj = new
System.Collections.ArrayList();


                 obj.Add("2");


                 obj.Add("3");


                 obj.Add("4");


                 obj.Add("5");


                 obj.Add("6");


                 obj.Add("7");


                 return obj;



           }




No comments:

Post a Comment