How To Maintain Scroll Position during Postback in AbleCommerce 7

by Joe Payne 19. May 2011 14:23

If you've ever spent hours writing a page only to have it jump all over the place during any postback, this tip will make your day.  With one simple command in Page_Load() you can make the page stay exactly where it was before the postback fired.

In your Page_Load() routine, add this line:

this.Page.MaintainScrollPositionOnPostBack = true;

 

Now some will say "I can already do that in the .ASPX file."  That's swell, but in AbleCommerce-Land you rarely work with the original .ASPX file.  In AbleCommerce-Land the vast majority of your work will be inside User Controls, so you don't have direct access to the page declaration.

Using this technique works great in a user control and you don't have to worry about modifications to a .ASPX file conflicting with other controls that use the same .ASPX file.

Nifty!  Winking smile

Tags: , ,

AC7 Articles | Personal | Tech Support

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Month List