RSS 2.0
# Thursday, April 16, 2009

I spent quite a bit of time researching and testing various solutions in trying to preserve focus on the dynamically created control causing a postback in .Net, but nothing seemed to work, most likely due to the very dynamic nature of the page I was creating.

After thinking about what I was really trying to accomplish, I came to the realization that I was not so much concerned about maintaining focus as I was concerned about maintaining the scrolling position of the page.  After about 30 seconds of searching, I discovered a handy one-liner that solved all my problems.

Adding MaintainScrollPositionOnPostBack = True to Page_Load takes care of all of this.  So, no matter how long your page is, adding this one line of code to your page will preserve scroll location on post backs.

Thursday, April 16, 2009 6:14:40 AM (Mountain Standard Time, UTC-07:00)  #    Comments [0] -

Categories
Archive
<April 2009>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789
Blogroll
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
GeekzRule.com
Sign In
Statistics
Total Posts: 12
This Year: 0
This Month: 0
This Week: 0
Comments: 0
Themes
Pick a theme:
All Content © 2010, GeekzRule.com
DasBlog theme 'Business' created by Christoph De Baene (delarou)