Problem calling RegisterStartupScript.
Hi,
I need to populate a javascript message box on saving data from the Gridview to the database. I'm calling the RegisterStartupScript in the RowUpdating event as shown below. The result of the function call is captured in a hidden label. But the problem is the Javascript function Confirmation is called after the entire GridView1_RowUpdating() is executed. I wanted the result of the confirmation message based on that, the changes will be saved into the database. Any help? Thanks in advance
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
Page.RegisterStartupScript("Confirmation", "<script language='javascript'>Confirmation('Save')</script>");
if (label1.Text == true)
{
// Code for Saving changes.
}
// Do something else.
}
|