Friday, March 26, 2010

jQuery scrollto page

ScriptManager.RegisterStartupScript(this.Parent.Page, this.GetType(), "ScrollDown2Result",
"$(document).ready(function() {$" +
"('html,body').animate({ scrollTop: 800}, 'slow');" +
"});", true);

Saturday, March 20, 2010

javascript execution after asynchronous postbacks

If you are in a user control you have to reference the parent in RegisterStartupScript.

ScriptManager.RegisterStartupScript(this.Parent.Page, this.GetType(), "foo", "document.getElementById('" + this.ad_display.ClientID + "').innerHTML = ('" + DateTime.Now.ToString("yyyyMMddhhmmss") + "');", true);