Dim dt As New DataTable
Dim dr As DataRow
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If (Me.Session("x") Is Nothing) Then
dt = New DataTable
dt.Columns.Add("A")
dt.Columns.Add("B")
dt.Columns.Add("C")
dr = dt.NewRow
dr("A") = "a"
dr("B") = "b"
dr("C") = "c"
Me.Session("x") = dt
Else
dt = Me.Session("x")
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
dr = dt.NewRow()
dr("A") = ""
dr("B") = ""
dr("C") = ""
dt.Rows.Add(dr)
GridView1.DataSource = dt
GridView1.DataBind()
End Sub