Professional Web Applications Themes

When resubmitting a long page, how do you preserve the vertical position on the page? - ASP Database

Hello, I've got a long page that resubmits itself to pass variable settings like this: http://localhost/hwlist2.asp?user=Kithmaker&user2=&sortby=cNumber the problem is that when the page reloads the user starts at the top again. Is there any way of preserving the vertical position the user is viewing on the page? Thanks, Mike...

  1. #1

    Default When resubmitting a long page, how do you preserve the vertical position on the page?

    Hello,

    I've got a long page that resubmits itself to pass variable settings
    like this:

    http://localhost/hwlist2.asp?user=Kithmaker&user2=&sortby=cNumber

    the problem is that when the page reloads the user starts at the top
    again. Is there any way of preserving the vertical position the user
    is viewing on the page?

    Thanks,
    Mike
    Mike Guest

  2. #2

    Default Re: When resubmitting a long page, how do you preserve the vertical position on the page?

    Mike wrote on 04 sep 2004 in microsoft.public.inetserver.asp.db: 

    Is this databaserelated? Don't think so.

    Is this ASP related? Don't think so.

    Please ask a clientside NG.



    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)

    Evertjan. Guest

  3. #3

    Default Re: When resubmitting a long page, how do you preserve the vertical position on the page?

    Mike wrote: 


    This is mostly a client-side coding question. Let me address the small
    portion that will be asp-related:

    Is it long due to lengthy text? Or is it long due to many controls on the
    page? If the latter, you can add a hiiden textbox to the page and use
    client-side code in the onsubmit event to populate that textbox with the
    name of the control that curently has focus. Then your server-side code can
    pass that id back to the winow_onload event:

    <%
    dim sActiveControlID
    sActiveControl = Request.Form("txtActiveControlID")
    'substitute Querystring for Form if using Get
    ....
    %>
    <html>
    <head>
    <script language=javascript>
    function window_onload() {
    var sActiveID = "<%=sActiveControlID%>"

    where the focus() method can be used in conjunction with the
    getElementByID() method to set focus to to that control. You may also need
    to use the scrollIIntoView() method to cause it to scroll into view:


    var obj=doent.getElementByID(sActiveID)
    obj.focus()
    obj.scrollIntoView()
    ....


    For more detail, see one of the scripting groups, or one of the groups with
    "dhtml" in their name. The abopve is air code and I did not bother looking
    up the proper syntax or spelling of the methods used in the client-code
    section. The DHTML doentation (as well as the doentation for all MS
    technologies) can be found here: http://msdn.microsoft.com/library. Drill
    down in the menu starting at Web Development down to HTML and Dynamic HTML.

    HTH,
    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"


    Bob Guest

  4. #4

    Default Re: When resubmitting a long page, how do you preserve the vertical position on the page?

    use a html anchor tag think they are called bookmarks or something like that
    try finding more info on google.

    for example place <a name="mid"></a> in your page and reference that with

    page.asp#mid in your code ie. response.redirect "page.asp#mid" and thats
    where it will put you

    you will need to put the a name where you want the user to return to on your
    page

    that should work but its untested by me

    :)

    "Mike" <com> wrote in message
    news:google.com... 


    Steven Guest

Similar Threads

  1. linking from page to a position in another
    By quiero mas in forum Macromedia Dynamic HTML
    Replies: 2
    Last Post: March 16th, 01:41 PM
  2. page scroll position
    By Venkat Chellam in forum ASP.NET Data Grid Control
    Replies: 2
    Last Post: December 4th, 04:09 AM
  3. Can't re-position page on artboard
    By Mark_Vincent@adobeforums.com in forum Adobe Illustrator Windows
    Replies: 4
    Last Post: July 15th, 05:03 AM
  4. Page Style Button Vertical Alighment
    By Gish Smith in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: September 19th, 11:55 AM
  5. how to position a table at top of page?
    By michel in forum Macromedia Dreamweaver
    Replies: 0
    Last Post: July 8th, 01:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139