As per your suggestion, I have modified the article.
V
VesteditedPosted Dec 17, 2010, 2:36 AMEdited Dec 17, 2010, 2:36 AM
Thank you for your article. However, I think that you should modify it a bit, because you use the deprecated method: http://msdn.microsoft.com/en-us/library/system.web.ui.page.registerstartupscript.aspx
As you know it is very easy to scroll a page in ASP.Net, by defining an anchor tag you can do this but in this article I am going to explain for you how to a scroll page from server side with the help of JavaScript method scrollIntoView.
For that you have to write JavaScript like the following in code behind. Here I have defined one method in code behind.
In the above method I have registered the script for setting the Scroll and Focus.
After that I have called the defined method in the Page Load like that.
Code
if (!Page.IsStartupScriptRegistered("setScrollAndFocus")){ ScrollToMyFavouriteControl(TextBoxMyFavourite);}
Since I got one comment for this article, Yes it is true that RegisterStartupScript is obsolete in higher .Net framework versions, so what is the alternative.
You can replace RegisterStartupScript with ClientScript.RegisterStartupScript like this.
Jake KoornhofPosted Jun 23, 2011, 8:32 AM
Thank you , this works excellent, just what I was looking for
Blocked AccountPosted Dec 21, 2010, 2:07 AM
As per your suggestion, I have modified the article.
VesteditedPosted Dec 17, 2010, 2:36 AMEdited Dec 17, 2010, 2:36 AM
Thank you for your article. However, I think that you should modify it a bit, because you use the deprecated method: http://msdn.microsoft.com/en-us/library/system.web.ui.page.registerstartupscript.aspx