In my master page, there is a user control (error control) that is initially hidden (visible set to false).
When the submit button is clicked, I show the error control. After postback, I want to focus on this control. To achieve this, I am writing JavaScript code in registered startup script as shown below:
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Scroll", "window.scrollTo(0, 0)", true);
After postback, the page jumps up to display this control and then returns to its original scroll position.