I have the following setup:
UpdatePanel -> Multiview -> 3 Views
When I click on a button in one of the views, it should go to the next view and slowly scroll to the top.
Currently I've been trying the following methods, of which none worked (not even a quick scroll - it just stays still laughing at me ;-) ):
protected void PartOneContinue_Click(object sender, EventArgs e)
{
CheckoutFlow.SetActiveView(PaymentMethodView);
ScriptManager.RegisterStartupScript(this, this.GetType(), "myscript", "<script>scrollTo(0,0);</script>", true);
}
And the following:
ScriptManager.RegisterStartupScript(this, this.GetType(), "myscript", "<script>$(window).scrollTop(100);</script>", true);
And the following where ScrollToTop
was a function with the two different scripts from above:
ClientScriptManager cs = Page.ClientScript;
cs.RegisterStartupScript(this.GetType(), "ScrollToTop", "ScrollToTop()");
Any ideas would be highly appreciated.