ASP.Net - Postback

Page properties

  • MaintainPositionOnScrollback - is a property in ASP.Net forms that allows you to tell the website to return to the location where you were before the postback was triggered.

To use this:

  1. Add the MaintainPositionOnScrollback=”true” property to the page element on the form.
  2. In your code which triggered the postback, add a statement like ‘ddlAttendanceCode.Focus’. What this does is instruct the system to focus on this control.

During postback, the system will then scroll down to the control that should have the focus.