Hi,
I have already sent an e-mail to you, I will post it also here for further reference.
You need to use your control inside the "User control" web part from General category. In this user control is the correct life cycle ensured.
The code behind could look like this :
if (!this.IsPostBack) //this is in the Page_Load
{
this.NewsGrid.DeleteCommand += new DataGridCommandEventHandler(NewsGrid_DeleteCommand);
Binddata();
}
}
public void NewsGrid_DeleteCommand(object source, DataGridCommandEventArgs e)
{
Response.Write("delete hit");
}
public void Binddata()
{
//bind some data here to the grid
}
Best Regards,
Juraj Ondrus