Hi ,
I tried some code for you check this once,
This is just for sample to get you idea how to do it .in this example i just used session variable to store entered data .
<form id="form1" runat="server">
<table width="100%">
<tr>
<td>First Name</td>
<td></td>
<td>
<asp:textbox id="TextBox1" runat="server" xmlns:asp="#unknown"></asp:textbox></td>
</tr>
<tr>
<td>Last Name</td>
<td></td>
<td> <asp:textbox id="TextBox2" runat="server" xmlns:asp="#unknown"></asp:textbox></td>
</tr>
<tr>
<td colspan="3">
<asp:button id="Button1" runat="server" text="Add" onclick="Button1_Click" xmlns:asp="#unknown" />
</td>
</tr>
</table>
<br />
<asp:gridview id="GridView1" runat="server" xmlns:asp="#unknown">
</asp:gridview>
</form>
after this you've to write some code
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.Add("fname");
dt.Columns.Add("lname");
DataRow dr = dt.NewRow();
dr[0] = "Murali";
dr[1] = "krishna";
dt.Rows.Add(dr);
Session["TempData"] = dt;
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
DataTable dt = (DataTable)Session["TempData"];
DataRow dr = dt.NewRow();
dr[0] = TextBox1.Text;
dr[1] = TextBox2 .Text ;
dt.Rows.Add(dr);
Session["TempData"] = dt;
GridView1.DataSource = (DataTable)Session["TempData"];
GridView1.DataBind();
}
Here i'm just made this code for testing you've to modify this to fullfill your requiremens
All the Best