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
2010-01-19 03:56:34
Hi Joel, Below is my code to bind the data to grid, if(!IsPostBack) { grdData.DataSource = GetEmployeeList(); grdData.DataBind(); }
Hari
2010-01-19 04:05:50
What is the related event you're binding the linkbutton to? Are you using the RowCommand event?
Joel Etherton
2010-01-19 12:42:59