Tuesday, October 25, 2011

Maintaining Scroll Position on Postback

Don't you hate it when you're trying to solve a problem and you find old answers to problems that have since been solved for you? Well, almost solved --or more betterer solved than before. 

http://www.4guysfromrolla.com/articles/111704-1.aspx presents problems with <%@ Page SmartNavigation="true" %> and gives Javascript examples with hidden fields.  This was a version 1.0 problem, since deprecated.  

Microsoft fixed it with  Page.SetFocus and Page.MaintainScrollPositionOnPostBack. Still, trying to set the focus on a field within a templated control or within a named container  requires you to either understand the control hierarchy, or use a recursion method that acts like a squirrel running up and down a tree and back and forth on each branch looking for his nuts.  

Things get complicated when using a Master Page and children Pages --more later


Young Roofers

Young Roofers
Men Making

Fly. Be Free.

Fly. Be Free.
Man Ready to Hang ... Glide

Burke

Burke
A Man in the Making - 12 years old

Blackwater

Blackwater
A Man in the Mud