I need to autopostback my page on the first load, and i need to wait the entire page have finish loading before post back the page.
I use in the page load
if (!IsPageWasPostBack)
{
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "forcePostBack", "Sys.WebForms.PageRequestManager.getInstance().add_endRequest(postBackLoading);function postBackLoading(){__doPostBack('" + this.Page.ClientID + "','');}", true);
}
IsPageWasPostBack is a viewstate variable.
When i put
Sys.WebForms.PageRequestManager.getInstance().add_endRequest
my page dont post back. If i remove it the page post back succesfully but to fast.
I dont want use timer to call back my post back.
Any idea ?