dont use abouve both solution that does not work good and difficult to use, use MaintainScrollPositionOnPostback="true" in ur page tag its provided by framework and really greate
At first, it does not need to any scroll operation. However, when the user click to activate the search, it is desirable to return the postback page and scroll to the bottom or in the middle.
It needs to control the scrolling option in the server side.
geossl
Member
24 Points
85 Posts
How to make browser scroll to the bottom of page
Aug 25, 2010 10:08 AM|LINK
Hi All,
How to use asp.net C# to scroll to the bottom on page on post back or programmatically decision?
web form C# asp.net 3.5 scrolling
rizwanparkar
Contributor
2394 Points
421 Posts
Re: How to make browser scroll to the bottom of page
Aug 25, 2010 11:10 AM|LINK
in javascript do like
<body onload="window.scrollTo(0,document.height)"
If the post helps you, please Mark it As Answer.
regards
-------------------
Rizwan Hanif Parkar
bose
Member
268 Points
96 Posts
Re: How to make browser scroll to the bottom of page
Aug 25, 2010 11:21 AM|LINK
Hi,
try this is in aspx page
<body style="overflow-x:scroll;">
this is an ordinary web page..
if u are working in content page
put one division like below
<div style="overflow-x:scroll;">
// controls
</div>
hope this will help u..
vaibh
Member
175 Points
88 Posts
Re: How to make browser scroll to the bottom of page
Aug 25, 2010 11:28 AM|LINK
heyy hi,
dont use abouve both solution that does not work good and difficult to use, use MaintainScrollPositionOnPostback="true" in ur page tag its provided by framework and really greate
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ViewQuotation.aspx.cs" Inherits="ViewQuotation"
EnableEventValidation="False" MaintainScrollPositionOnPostback="true" %>
remember to mark and give me stars because i need many time to find this solution.
Menu vaibhav asp .Forumn problems c# filtering sorting tables
MCTS Web Application
Software Developer
http://www.vaibhavmayee.com
If u like the solution then mark as answer !!
Bhaarat
Contributor
3403 Points
850 Posts
Re: How to make browser scroll to the bottom of page
Aug 25, 2010 11:38 AM|LINK
try this
<html> <body> <div><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br /> </div> 1 <script type="text/javascript"> window.scrollTo(0, document.body.offsetHeight); </script> </body> </html>All The Best
Remember to click "Mark as Answer" on the post that helps U
http://ransandeep.blogspot.com
geossl
Member
24 Points
85 Posts
Re: How to make browser scroll to the bottom of page
Aug 26, 2010 01:57 AM|LINK
Actually, it is a search page.
At first, it does not need to any scroll operation. However, when the user click to activate the search, it is desirable to return the postback page and scroll to the bottom or in the middle.
It needs to control the scrolling option in the server side.
Any suggestion for this?
bose
Member
268 Points
96 Posts
Re: How to make browser scroll to the bottom of page
Aug 26, 2010 04:21 AM|LINK
Hi,
I have give the scroll in body tag,
if u want any other tag, same u can try.. refer my example also.
this is based on server side.
<body runat="server" id="frmBody1">
private void search_click(object sender,EventArgs e)
{
try
{
frmBody1.Attributes.Add("style", "overflow-x:scroll");
}
catch(exception)
{
}
}
Zizhuoye Che...
All-Star
21915 Points
1915 Posts
Re: How to make browser scroll to the bottom of page
Aug 27, 2010 08:50 AM|LINK
Hi,
You can try this code:
aspx:
aspx.cs:
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
string script = @"window.onload = function SetButtonScroll() {
var height = document.body.scrollHeight;
var width = document.body.scrollWidth;
window.scrollTo(0, height);
}";
this.ClientScript.RegisterStartupScript(this.GetType(), "setScroll", script,true);
}
}
Hopes can help you.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
nishit_123
Contributor
3650 Points
627 Posts
Re: How to make browser scroll to the bottom of page
Aug 27, 2010 12:19 PM|LINK
Add MaintainScrollPositionOnPostback="true" in page directive