Scrollbar
-
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 --
-
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 --
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 anonclick
handler will do. If you need more information, ask in the appropriate forum.Microsoft MVP, Visual C# My Articles
-
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 --
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
-
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 --
just add a regular HTML button input type to the html, and don't rely on the designer to much...:
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; }