hi,
guess u can call OnTextChanged event in the codebehind and try to access the gridview from there.
below code might help:
<asp:textbox id="TextBox1" runat="server" autopostback="true" ontextchanged="text" xmlns:asp="#unknown"></asp:textbox>
data access layer:
public DataTable populategridview(int id)
{
SqlDataAdapter da = new SqlDataAdapter("select empname from development.dbo.employee where empid='" + id + "'", xconn);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}
Codebehind:
protected void text(object sender, EventArgs e)
{
DAL obj2 = new DAL();
int id = Convert.ToInt32(TextBox1.Text);
DataTable dtnew = obj2.populategridview(id);
grdview.DataSource = dtnew;
grdview.DataBind();
}
try to do somethng like above..guess it should work..havent tested it though...:)
regards
anurag