I need to insert a bit of Javascript into the process when a Web Form is submitted, but after the client side validation takes place.
RegisterOnSubmitStatement seems to
that´s right, the RegisterOnSubmitStatement DO NOT WORK in the init function. It should be called after in the page lige cycle. I thing the right place therefor is:
"PreRenderComplete"
protected override OnInit(EventArgs e)
{
Page.PreRenderComplete+= new EventHandler(Page_PreRenderComplete);
base.OnInit(e);
}
void Page_PreRenderComplete(object sender, EventArgs e)
{
Page.ClientScript.RegisterOnSubmitStatement(typeof(Page), "name", "JS code here");
}