V
Valli
Hi,
I am a fresher to asp.net programming.
I want to add rows to html table dynamically. I am able to do this
using javascript.
But i need to add rows to table in aspx.vb page. The oding what i wrote
adds a row to a table but doesnt display the record.
When I retrieve value from the cell, it returns the value. Is there
anything wroing in my coding.
Please help me friends.
My code follows here:
Private Sub psAddNewRow()
Dim flag As Boolean = False
flag = True
If flag = True Then
Dim row As New HtmlControls.HtmlTableRow
Dim td1 As New HtmlControls.HtmlTableCell
Dim td2 As New HtmlControls.HtmlTableCell
Dim td3 As New HtmlControls.HtmlTableCell
Dim td4 As New HtmlControls.HtmlTableCell
Dim td5 As New HtmlControls.HtmlTableCell
Dim td6 As New HtmlControls.HtmlTableCell
Dim td7 As New HtmlControls.HtmlTableCell
Dim td8 As New HtmlControls.HtmlTableCell
Dim td9 As New HtmlControls.HtmlTableCell
Dim td10 As New HtmlControls.HtmlTableCell
Dim td11 As New HtmlControls.HtmlTableCell
Dim strHtml1 As String
Dim strHtml2 As String
strHtml1 = "<INPUT TYPE=\""Button\"" CLASS=\""but\""
onClick=\""EditRow(this)\"" VALUE=\""Edit\"">"
strHtml2 = "<INPUT TYPE=\""Button\"" CLASS=\""but\""
onClick=\""DeleteRow(this)\"" VALUE=\""Delete\"">"
td1.InnerHtml = "Order"
td2.InnerHtml = "Order2"
td3.InnerHtml = "Order3"
td4.InnerHtml = "Order4"
td5.InnerHtml = "Order5"
td6.InnerHtml = "Order6"
td7.InnerHtml = "Order7"
td8.InnerHtml = "Order8"
td9.InnerHtml = "Order9"
'td10.InnerHtml = strHtml1
'td11.InnerHtml = strHtml2
row.Cells.Add(td1)
row.Cells.Add(td2)
row.Cells.Add(td3)
row.Cells.Add(td4)
row.Cells.Add(td5)
row.Cells.Add(td6)
row.Cells.Add(td7)
row.Cells.Add(td8)
row.Cells.Add(td9)
'row.Cells.Add(td10)
'row.Cells.Add(td11)
tblorederlist.Rows.Add(row) 'Add a row to table
lblOrderOrPosition.Text = tblorederlist.Rows.Count
I am a fresher to asp.net programming.
I want to add rows to html table dynamically. I am able to do this
using javascript.
But i need to add rows to table in aspx.vb page. The oding what i wrote
adds a row to a table but doesnt display the record.
When I retrieve value from the cell, it returns the value. Is there
anything wroing in my coding.
Please help me friends.
My code follows here:
Private Sub psAddNewRow()
Dim flag As Boolean = False
flag = True
If flag = True Then
Dim row As New HtmlControls.HtmlTableRow
Dim td1 As New HtmlControls.HtmlTableCell
Dim td2 As New HtmlControls.HtmlTableCell
Dim td3 As New HtmlControls.HtmlTableCell
Dim td4 As New HtmlControls.HtmlTableCell
Dim td5 As New HtmlControls.HtmlTableCell
Dim td6 As New HtmlControls.HtmlTableCell
Dim td7 As New HtmlControls.HtmlTableCell
Dim td8 As New HtmlControls.HtmlTableCell
Dim td9 As New HtmlControls.HtmlTableCell
Dim td10 As New HtmlControls.HtmlTableCell
Dim td11 As New HtmlControls.HtmlTableCell
Dim strHtml1 As String
Dim strHtml2 As String
strHtml1 = "<INPUT TYPE=\""Button\"" CLASS=\""but\""
onClick=\""EditRow(this)\"" VALUE=\""Edit\"">"
strHtml2 = "<INPUT TYPE=\""Button\"" CLASS=\""but\""
onClick=\""DeleteRow(this)\"" VALUE=\""Delete\"">"
td1.InnerHtml = "Order"
td2.InnerHtml = "Order2"
td3.InnerHtml = "Order3"
td4.InnerHtml = "Order4"
td5.InnerHtml = "Order5"
td6.InnerHtml = "Order6"
td7.InnerHtml = "Order7"
td8.InnerHtml = "Order8"
td9.InnerHtml = "Order9"
'td10.InnerHtml = strHtml1
'td11.InnerHtml = strHtml2
row.Cells.Add(td1)
row.Cells.Add(td2)
row.Cells.Add(td3)
row.Cells.Add(td4)
row.Cells.Add(td5)
row.Cells.Add(td6)
row.Cells.Add(td7)
row.Cells.Add(td8)
row.Cells.Add(td9)
'row.Cells.Add(td10)
'row.Cells.Add(td11)
tblorederlist.Rows.Add(row) 'Add a row to table
lblOrderOrPosition.Text = tblorederlist.Rows.Count