views:

221

answers:

1

Hi, In a page, i put a gridview with several template field columns. In one of the template field, i have a linkbutton. Before postback i bind the grid with data. Once page loads, when i click the linkbutton in gridview, it is not firing the related event and its return a empty aspx page.

+1  A: 

It sounds like you're not checking for a PostBack before running a DataBind(). If you continually bind your data, ViewState will be recreated each time and you'll lose what you had.

Joel Etherton
Hi Joel, Below is my code to bind the data to grid, if(!IsPostBack) { grdData.DataSource = GetEmployeeList(); grdData.DataBind(); }
Hari
What is the related event you're binding the linkbutton to? Are you using the RowCommand event?
Joel Etherton