A
Axel Dahmen
Hi,
in ASP.NET control events are being fired *after* the Page_Load event. I
need it the other way around. Is this possible?
Here's my example (just pseudo code):
Page_Load()
{
DataGrid.DataSource="...";
DataGrid.DataBind();
}
RemoveButton_Click()
{
SqlCommand.CommandText="DELETE ... WHERE ...";
SqlCommand.ExecuteNonQuery();
}
If I hit the RemoveButton during runtime, the DataGrid will display obsolete
data, because it is bound *before* the RemoveButton_Click() event is called.
AFAIK, performing DataGrid binding within the Page_Load event is the only
practicable way as there is no other event being called if not on PostBack.
If I have several buttons on the page, I don't see another way to put the
DataSource/DataBind pair somewhere else.
Your help is quite appreciated.
TIA,
Axel Dahmen
in ASP.NET control events are being fired *after* the Page_Load event. I
need it the other way around. Is this possible?
Here's my example (just pseudo code):
Page_Load()
{
DataGrid.DataSource="...";
DataGrid.DataBind();
}
RemoveButton_Click()
{
SqlCommand.CommandText="DELETE ... WHERE ...";
SqlCommand.ExecuteNonQuery();
}
If I hit the RemoveButton during runtime, the DataGrid will display obsolete
data, because it is bound *before* the RemoveButton_Click() event is called.
AFAIK, performing DataGrid binding within the Page_Load event is the only
practicable way as there is no other event being called if not on PostBack.
If I have several buttons on the page, I don't see another way to put the
DataSource/DataBind pair somewhere else.
Your help is quite appreciated.
TIA,
Axel Dahmen