Geek Articles

Categories

 

Subscribe

Daily Updates Subscribe geekarticles update via email Subscribe geekarticles update via RSS

 
GeekArticles Database SQL Server

Resetting Scroll Position When Using

Author: aspnet.4guysfromrolla.com | Published: 14th Nov 2007 | Visited: 134 times | Add Comment
Filed in: SQL Server

ASP.NET 2.0 added a number of built-in client-side enhancements that were missing from earlier versions. Many of these new features were detailed in an earlier article here on 4Guys, Client-Side Enhancements in ASP.NET 2.0. One of the least undocumented yet most helpful client-side enhancement, in my opinion, is MaintainScrollPositionOnPostback. As its name implies, MaintainScrollPositionOnPostback ensures that the browser's scroll position is maintained across postbacks. Without MaintainScrollPositionOnPostback, when a user visits a web page that is "taller" than the browser window, they have to scroll down to see the content further down on the page. If the user then clicks on a Button or performs some other action that causes a postback, the browser reloads the page and, by default, returns to the home scroll position at the top of the page, requiring the user to scroll back down to the location they were viewing when the postback occurred. To have the user's scroll position remembered across postbacks, simply set MaintainScrollPositionOnPostback to True, which can be done on a page-by-page basis or applied to all pages by configuring this option through Web.config. While MaintainScrollPositionOnPostback makes it easy to keep the visitor at the same scroll position across postbacks, there are scenarios where you may not want to return the user to their scroll position on postback, but instead return them to the top of the page. One such example is when displaying a pageable grid. When the user edits a record, you would want to keep them at the same scroll position, but when they change the page or delete a record, you may want to reset their scroll position to the top on postback. In this article we will examine a way to override the behavior of MaintainScrollPositionOnPostback on a case-by-case basis. Read on to learn more! Read More >

Read Article
 

Sponsored Links

 


Related Articles

 How to Refresh a DBGrid without Loosing the Current Row Position in Delphi TIPS :: When DBGrid is used to display data from a dataset (query or table), by design, after you call Refresh method on a dataset (re-open) (for example ...

 Restore Form Position and Size in C# Presents some logic and code to intelligently restore windows' sizes and positi ...

 Scroll Window A scroll window that surpasses the 16-bit limit and can be hosted by a dia ...

 Persisting the scroll position of a div on ajax postbacks This article explains how you can persist the scroll position of a div, in ajax postb ...

 Mouse Position over Image in a PictueBox A custom control derived from the PictureBox control that demonstrates how to obtain the position of the mouse relative to the I ...

 Scroll caret into view after block completion (esp. TRY... FINALLY) QC#: 59366 Version: 11.2 Status: Open defect, requires resolution Description: When you open a TRY block, then go a few lines down and press Enter, the Block Completion adds the corresponding FINALLY...END part and sets the caret in there. So far so ...

 Designing with CSS - Part 6: Deciding Whether to Float or Position Columns Learn an alternative method for creating two-column layouts and the strengths and weaknesses of e ...

 Position in Tool Palette lost, should have been in a separate panel! QC#: 53360 Version: 11.0 Status: New defect, requires tester review Description: --- [Added on 23-Feb-08:] To summarize: the suggested feature/improvement is to add a small, easily configurable component palette docked inside the Form Designer windo ...

 Seeking and Getting position snippets for Directshow.Net How to seek and get position , duration with VB. ...

 A picture viewer class that can scroll and zoom using API This is a simple class that can view scroll and zoom pict ...



Next: Taking an ASP.NET 2.0 Application Offline



Post Comment

Name:


Email:
 (Optional. Used for Notification)

Title:

 
Comment:


Validation Code:
 <=>  (Enter this code in text box)





Latest Articles

 

Popular Articles

Sponsored Links