我从文本框中检索关键字并希望刷新绑定到 LinqDataSource 的 GridView。
我假设我可以在 OnTextChanged 函数中执行此操作,如下所示
protected void OnTextChanged(object sender, EventArgs e)
{
// do LINQ query based on content in textbox
catalogDataContext dc = new catalogDataContext();
var query = from product in dc.catalog
where product.Name.Contains(TextBox.Text)
select product;
// what do I have to do here to refresh the GridView? Thanks.
GridView.DataBind();
}