How do I register a Javascript function to run with every postback?
- by Kevin
I have a treeview in a user control. I need to run a javascript function with every synch postback to scroll the div it's in to the right position. I've got it working, but I think there has to be a "cleaner" way to do it. In the Page_Load function of the control, I have the following code. Is there a better way to do it?
ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "key" + DateTime.Now.Ticks, "RestorePosition();", true);