Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > positioning vertical scrollbar

Reply
Thread Tools

positioning vertical scrollbar

 
 
r pasadhy via .NET 247
Guest
Posts: n/a
 
      08-11-2004
Hi,
I am new to this list. So please forgive me if this question is arepeat.
Basically, there is this big aspnet form on which I have a lot ofdropdown listboxes. When the selected index changes on any ofthese dropdowns, the form resubmits. The problem is that whenthis happens the user is forced to the top of the page and hasto scoll down to where they were at before the submit. This isunderstandably very annoying. How can I position the verticalscroll bar so that the page refresh takes the user back to wherethey were?
Any help would be appreciated.
Thanks in advance.
R Pasadhy


--------------------------------
From: r pasadhy

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>vPRFeJTr5EKbV52MVtA/Sg==</Id>
 
Reply With Quote
 
 
 
 
jagadeesh
Guest
Posts: n/a
 
      08-11-2004
Try to use SmartNavigation for the page
"r pasadhy via .NET 247" <(E-Mail Removed)> wrote in message
news:e%(E-Mail Removed)...
Hi,
I am new to this list. So please forgive me if this question is a repeat.
Basically, there is this big aspnet form on which I have a lot of dropdown
listboxes. When the selected index changes on any of these dropdowns, the
form resubmits. The problem is that when this happens the user is forced to
the top of the page and has to scoll down to where they were at before the
submit. This is understandably very annoying. How can I position the
vertical scroll bar so that the page refresh takes the user back to where
they were?
Any help would be appreciated.
Thanks in advance.
R Pasadhy


--------------------------------
From: r pasadhy

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>vPRFeJTr5EKbV52MVtA/Sg==</Id>


 
Reply With Quote
 
 
 
 
Joe Fallon
Guest
Posts: n/a
 
      08-12-2004
'to remember scroll bar position so that postbacks restore the user to the
spot on the page where they were:
'any page that wants to use this feature needs to add this after the <form>
tag:
<input type="hidden" name="__SCROLLPOS" value="" />


'I add this code to my base page in PreRender method so the attributes are
added to the HTML Head tag whenever a form with that hidden field is posted.

If Not (Request("__SCROLLPOS") Is Nothing) AndAlso
Request("__SCROLLPOS") <> String.Empty Then
Dim pos As Integer = Convert.ToInt32(Request("__SCROLLPOS"))
.Attributes("onscroll") =
"javascript:if(document.forms[0].__SCROLLPOS)document.forms[0].__SCROLLPOS.value
= Body.scrollTop;"
.Attributes("onload") = "javascript:Body.scrollTop=" & pos & ";"
Else
.Attributes("onscroll") =
"javascript:if(document.forms[0].__SCROLLPOS)document.forms[0].__SCROLLPOS.value
= Body.scrollTop;"
End If

--
Joe Fallon




"r pasadhy via .NET 247" <(E-Mail Removed)> wrote in message
news:e%(E-Mail Removed)...
Hi,
I am new to this list. So please forgive me if this question is a repeat.
Basically, there is this big aspnet form on which I have a lot of dropdown
listboxes. When the selected index changes on any of these dropdowns, the
form resubmits. The problem is that when this happens the user is forced to
the top of the page and has to scoll down to where they were at before the
submit. This is understandably very annoying. How can I position the
vertical scroll bar so that the page refresh takes the user back to where
they were?
Any help would be appreciated.
Thanks in advance.
R Pasadhy


--------------------------------
From: r pasadhy

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>vPRFeJTr5EKbV52MVtA/Sg==</Id>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Listbox without vertical scrollbar? SJ ASP .Net 1 01-11-2006 09:59 PM
MultiLine TextBox, how to remove vertical scrollbar? Olav Tollefsen ASP .Net 1 01-29-2005 10:40 PM
ScrollBar? Does it exist just WEB ScrollBar Control? Alex ASP .Net Web Controls 1 04-04-2004 12:44 AM
vertical scrollbar, the taming of Sean HTML 2 08-07-2003 07:26 AM
How to include multiple frames in frameset without predefined dimensions/vertical scrollbar Don Schneider HTML 0 06-27-2003 03:32 PM



Advertisments