ARTICLE

Scroll to Top of page using jQuery in ASP.NET

Posted by Rohatash Kumar Articles | ASP.NET using VB.NET June 01, 2011
This article defines How to automatically scroll back to the top of the page.
Download Files:
 
Reader Level:

This article defines How to automatically scroll back to the top of the page.

If your pages are long winded, it's a good idea to provide viewers with an easy way to automatically scroll back to the top of the page. This script displays a stationary control at the lower right corner of the window that when clicked on gently scrolls the page back up to the top. Instead of always being visible on the user's screen, the script lets you specify how far down the page.

Step -1

Add the following code in the head section of the page.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

<script type="text/javascript" src="Scripts/scrolltopcontrol.js">

</script>

This section has the reference of the .js file which named as scrolltopcontrol.

Step-2

Now Adding the .js file in the project directory under the scripts folder. This file is attached with download file. We can download it from that and attach with the project.

image1.gif

Image1

Step -3

Now Adding a scroll control in the jquery file. This control is also attached with download file.

Scroll control will be display when your page is long winded.

Step -4

Now run the application.

image2.gif

Image2

Here scroll is in visible.

Now Drag scroll to down of page Then scroll control will be display.

Image3

image3.gif

Now click on the Scroll control to top of the page.

Login to add your contents and source code to this article
share this article :
post comment
 
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications. Visit DynamicPDF here
    Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Nevron Diagram
Become a Sponsor