Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Scrollbar

Scrollbar

Scheduled Pinned Locked Moved C#
question
4 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    _Searcher_
    wrote on last edited by
    #1

    Hi. I have a side bar with a menu in an iframe, this sidebar is is very long (heigh). When I click on a button at the bottom of the menu, it reloads and gos up to the top. I want the srollbar to stay at the bottom when I click on this button. Can I somehow use the (not) IsPostBack on the button? How can I do this? Thanks! -- Evil geniuses for a better tomorrow --

    H W P 3 Replies Last reply
    0
    • _ _Searcher_

      Hi. I have a side bar with a menu in an iframe, this sidebar is is very long (heigh). When I click on a button at the bottom of the menu, it reloads and gos up to the top. I want the srollbar to stay at the bottom when I click on this button. Can I somehow use the (not) IsPostBack on the button? How can I do this? Thanks! -- Evil geniuses for a better tomorrow --

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      For starters, this belongs in the ASP.NET forum. If you don't want the button to post back, however, then don't make it a server control. A simple button element with an onclick handler will do. If you need more information, ask in the appropriate forum.

      Microsoft MVP, Visual C# My Articles

      1 Reply Last reply
      0
      • _ _Searcher_

        Hi. I have a side bar with a menu in an iframe, this sidebar is is very long (heigh). When I click on a button at the bottom of the menu, it reloads and gos up to the top. I want the srollbar to stay at the bottom when I click on this button. Can I somehow use the (not) IsPostBack on the button? How can I do this? Thanks! -- Evil geniuses for a better tomorrow --

        W Offline
        W Offline
        Wender Oliveira
        wrote on last edited by
        #3

        You need some javascript function because each postback is a submit in your page. I was with this problem but with linkbutton and I solved it without js just by setting href="" and not href="#" like I did... but it was a linkbutton! Good luck! Wender Oliveira .NET Programmer

        1 Reply Last reply
        0
        • _ _Searcher_

          Hi. I have a side bar with a menu in an iframe, this sidebar is is very long (heigh). When I click on a button at the bottom of the menu, it reloads and gos up to the top. I want the srollbar to stay at the bottom when I click on this button. Can I somehow use the (not) IsPostBack on the button? How can I do this? Thanks! -- Evil geniuses for a better tomorrow --

          P Offline
          P Offline
          partyganger
          wrote on last edited by
          #4

          just add a regular HTML button input type to the html, and don't rely on the designer to much...: JS code (just googled for it... function scrollToBottom() { document.body.scrollTop = document.body.offsetHeight; } function checkIfScrollToBottomIsNeeded() { scrollToBottomIsNeeded = ( document.body.scrollTop >= ( document.body.offsetHeight - ( window.innerHeight * 1.2 ) ) ); } function scrollToBottomIfNeeded() { if( scrollToBottomIsNeeded ) document.body.scrollTop = document.body.offsetHeight; }

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups