473,508 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

maintain scroll position on postback in dynamically generated page in ASP.NET1.1+C#

3 New Member
Hi,
I have one .aspx file which is generating whole page dynamically by taking all the HTML tags from SQL SERVER 2000 database . This .aspx is also containing one user control ( which contains two dropdownlist box ).On selection of some Text in one dropdownlist box , whole page refreshes because autopostback="true" for dropdownlist box . Now after postback , i want to maintain the scroll position . for this i used following options :

1) SmartNavigation="true"
2) addition of third party dll
3) javascript

But all the above options were not working in this dynamically generated page .
So, could you please give me solution for this problem .
Please reply ASAP because i am in urgent need of this solution.
Aug 7 '06 #1
1 4587
DeepakZ
1 New Member
The following piece of code might work for you

<script language="javascript" event="onscroll" for="window">
<!--
return window_onscroll()
//-->
</script>
<script language="javascript" event="onload" for="window">
<!--
return window_onload()
//-->
</script>
<script language="javascript">
function window_onscroll()
{
//alert(document.frmQuoteDetails.hdnTopPos.value);
document.frmQuoteDetails.hdnTopPos.value = myBody.scrollTop;

if (myBody.scrollTop > 145)
document.all("div_QuoteSave").style.top = myBody.scrollTop;
else
document.all("div_QuoteSave").style.top = 145

if (myBody.scrollTop > 215)
document.all("div_Quote").style.top = myBody.scrollTop;
else
document.all("div_Quote").style.top = 215
}

function window_onload()
{
//alert(document.frmQuoteDetails.hdnTopPos.value);
window.scroll(9999,document.frmQuoteDetails.hdnTop Pos.value);
//document.frmQuoteDetails.hdnTopPos.value = "";
//alert(document.frmQuoteDetails.hdnTopPos.value);

}
Feb 11 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1810
by: GrantS | last post by:
I am trying to convert the VB.Net code example povided by http://authors.aspalliance.com/JimRoss/Articles/MaintainScrollPos.aspx into C# (ASP.Net)without success. No errors are thrown in the VB...
8
2120
by: ed | last post by:
Does anyone know if ASP.NET 2.0 is going to incorporate "maintain scroll position on postback" in non-IE browsers like Firefox? This seems like an often requested feature on these newsgroups...
5
15956
by: JezB | last post by:
There are a few references on the net about how to restore a page's scroll position over a postback. This is a simple one which works for me: eg....
3
6067
by: rmunson8 | last post by:
I have added Panel control to a web page which contains a GridView. The Panel's ScrollBars property is set to auto. When I select the Select CommanField button for a row (which obviously causes a...
1
2086
by: Wayne Sepega | last post by:
Ultimately what I need is a way to remember the scroll position of the form on a post back. I have a button that posts back to the current form and if there are no errors the form is reproduced, I...
0
2086
by: Keithb | last post by:
The maintain scroll position on postback feature works as expected with my site running under localhost on the development machine. When the files are posted to an IIS 6.0 web server running on a...
7
5579
by: Lit | last post by:
Hi, How can I capture the vertical scroll bar position for a Listbox. I have a Listbox of 100 items + when I click on it I post back remove the item selected. After returning to the client...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7132
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7063
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5640
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3211
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.