views:

799

answers:

3

I have an Panel control that I need to maintain position across postbacks. I am able to do this by maintaining a cookie which is read each time the page is loaded to get the position of the Panel before the page is loaded.

The problem is, the page is loaded, then repositioned which causes this brief flash where the control is at its default location and jumps to the location it was at prior to postback.

Is there a way to prevent this? I want the control to move to its position first, THEN have it displayed to prevent this "flash".

*edit: I am adding a DragPanel ajax control extender to reposition this. I have a pageLoad that is called and the Panel is repositioned after pageLoad is called. There's gotta be a really simple solution to this.

+1  A: 

Could you register the function that positions the panel in the pageLoad event of the ASP.NET client-side library?

This link may be helpful: ASP.NET AJAX Client Life-Cycle Events

Pau
A: 

Because you're storing the panel's location in a cookie, you could update the panel's location during the server side postback event.

AaronSieb
A: 

Since you already have code to reposition the panel during pageLoad, you can add code on server side to hide the panel when IsPostback.

On pageLoad, you'll need to add step to set panel.style.display='' after panel after reposition.

Ricky Supit