to post a text content at runtime to same page
i am developing a web page ,in which i have to put a textbox and a button.Textbox text to be filled at run time and after clicking on submit button ,it submits on the same page in a panel or table or any control.i need a help regarding this.plz help me soon.

Satyapriya NayakPosted May 19, 2012, 12:18 PM
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace WebApplication15
{
public partial class _Default : System.Web.UI.Page
{
protected void Button1_Click(object sender, EventArgs e)
{
bind();
}
void bind()
{
DataTable dt = new DataTable();
dt.Columns.Add("Name", typeof(string));
DataRow dr = dt.NewRow();
dr["Name"] = TextBox1.Text.ToString();
dt.Rows.Add(dr);
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
Thanks
Chuk MbaPosted May 19, 2012, 11:00 AM