Squeezing in between LoadViewState and LoadPostData

Squeezing in between LoadViewState and LoadPostData

am 13.01.2008 17:40:56 von kaniga

Hi,

I am trying to build an application framework for loading data into my
page controls (data-binding).

I though that I could load the data at Page_Init (calling to the
applications Business Logic),
and this would allow me to get the user's selections on postbacks,
i.e.
if I fill a drop-down-list on page init, I would get the user's
selection just before the Page_Load.


The problem is that I want to have the viewstate for my controls ready
for me, so I know which data I should load when I call the Business
Logic.

For example,
if I have a grid with a sorted column set, I want to get that sorted
column on every postback, so I can get the data with the proper ORDER
BY.

So I figured I should squeeze in between LoadViewState and
LoadPostData (which loads user's selections).
The problem is that there is no such event:
I cannot override LoadViewState for the page because it occurs just
before LoadViewState for all of the child controls.

Is there any solution for this ?

Yair Benyami.

RE: Squeezing in between LoadViewState and LoadPostData

am 14.01.2008 18:07:03 von brucebarker

use the LoadViewState override. just call the base method (which will load
viewstate) before calling your framework code.

-- bruce (sqlwork.com)


"kaniga" wrote:

> Hi,
>
> I am trying to build an application framework for loading data into my
> page controls (data-binding).
>
> I though that I could load the data at Page_Init (calling to the
> applications Business Logic),
> and this would allow me to get the user's selections on postbacks,
> i.e.
> if I fill a drop-down-list on page init, I would get the user's
> selection just before the Page_Load.
>
>
> The problem is that I want to have the viewstate for my controls ready
> for me, so I know which data I should load when I call the Business
> Logic.
>
> For example,
> if I have a grid with a sorted column set, I want to get that sorted
> column on every postback, so I can get the data with the proper ORDER
> BY.
>
> So I figured I should squeeze in between LoadViewState and
> LoadPostData (which loads user's selections).
> The problem is that there is no such event:
> I cannot override LoadViewState for the page because it occurs just
> before LoadViewState for all of the child controls.
>
> Is there any solution for this ?
>
> Yair Benyami.
>

Re: Squeezing in between LoadViewState and LoadPostData

am 15.01.2008 11:04:25 von kaniga

The problem is that the LoadViewState method for the page is called
BEFORE the LoadViewState for any of its child controls.

I need to be able to respond AFTER all LoadViewState methods are
called and before LoadPostData.