how do Back To Top in [Resolved]

Posted by Cpatil1000 under ASP.NET on 5/30/2016 | Points: 10 | Views : 444 | Status : [Member] | Replies : 2
i am working in the bootstrap with . my child form is 'content'. i am trying this following coding. I want when page is gone buttom
the bottom to top image display and when i press that image my page should go top.

<asp:Content ID="Content1" ContentPlaceHolderID="cHead" runat="Server">
<link href="Style/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="Style/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="Script/jquery-1.4.1.min.js" type="text/javascript"></script>
<script src="Script/jquery-1.4.1.js" type="text/javascript"></script>
<link rel="stylesheet" href="" />
<script type="text/javascript">
$(document).ready(function () {
//Hide Back to top button
$(window).scroll(function () {
if ($(window).scrollTop() > 200) {
} else {
$('#back-to-top img').click(function () {
scrollTop: 0
}, 1000);
<style type="text/css">
position: fixed;
bottom: 30px;
top: 350px;
#back-to-top img
cursor: pointer;
<asp:Content ID="Content2" ContentPlaceHolderID="mBody" runat="Server">
<!-- /navbar -->
Back To Top Demo by Nitesh Luharuka</h1>
<div class="container" style="height: 1000px">
<span id="back-to-top">
<img alt="" src="Image/Arrow-Up.png" /></span>


Posted by: Sheonarayan on: 5/30/2016 [Administrator] HonoraryPlatinum | Points: 50


You can write following code

<a href="#top"><img alt="" src="Image/Arrow-Up.png" /></a>

The other way is this using jQuery

function GoTop() {
$('html, body').animate({ scrollTop: 0 }, 'fast');
<a href="javascript:GoTop()" title="Go to top">Go Top</a>

Hope this helps.

Sheo Narayan

Cpatil1000, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: TANMAY007100 on: 5/30/2016 [Member] Starter | Points: 25

Your code is working fine there are no errors Cpatil1000. If any exist I guess you don't see your image in your browser. If it is so then you should write this:

<img alt="" src="/Image/Arrow-Up.png" />

the first '/' character represents root of website from there to folder Image & then to Arrow-Up.png.

Hope this solves your issue.

Cpatil1000, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response