Skip to main content

Posts

Showing posts with the label smart page postback

Maintaining Control Focus on Postback in ASP .NET

I have recently got an issue with massive ASP .NET Web Form which is needed for a lot of details to be entered and takes several screens to display. When you edited something in the middle of the form and initiate a postback - the form was displayed from the top. In my case Web Form was a part of custom Web Control which is rendered within the SmartPart for SharePoint . I found the following article which helped me - How to implement the smart navigation features in ASP.NET 2.0 . I put the following instruction in the OnInit event handler for my Web Control: this.Page.MaintainScrollPositionOnPostBack = true; It helped! Now when I do something on postback my Web Control scrolls back to the place I edited last. Simple but powerful.