Asp.NET, Ajax, Usercontrols, Event bubbling

Asp.NET, Ajax, Usercontrols, Event bubbling

am 17.04.2008 23:24:22 von m.bagattini

Hello folks, I'm in trouble with an application using methodologies in
subject.

The idea is to have a single-page application. The host aspx page
coordinates all visualizations, loading and populating different
usercontrols on a status basis.

To listen for changes I'm bubbling up events from the usercontrols.
Each event raises up to the host aspx page, which decides what to do,
what to load etc.

I have to say that this works on a non-ajax environment.

My problem is that, using updatepanels, the result I get is similar to
a full-postback, everything is updated after an event, even those
updatepanels I want to keep not up-to-date.
This, I suppose, is due to the fact that, having to recreate runtime
usercontrols on page_init (otherwise events are not listened),
everything is seen as modified and posted back to client. This is what
I think but maybe I'm wrong.

I tried to do a proof-of-concept of this situation, maybe something is
missing but reproduces the problem.

I can't attach from this interface, so you can find the zip file on
following url:
http://snipurl.com/24sfn

As you can see, even being in separated updatepanels, everything is
updated on postback

Thanks in advance,
mt

Re: Asp.NET, Ajax, Usercontrols, Event bubbling

am 20.04.2008 07:27:56 von DFS

you need to understand the update panel model. with an update panel, all
data is posted back, and a complete page processing cycle is done. the
only trick, with a panel, is only the html in the panel(s) is sent back
to the client, and the panels inner html is updated.

-- bruce (sqlwork.com)

m.bagattini@gmail.com wrote:
> Hello folks, I'm in trouble with an application using methodologies in
> subject.
>
> The idea is to have a single-page application. The host aspx page
> coordinates all visualizations, loading and populating different
> usercontrols on a status basis.
>
> To listen for changes I'm bubbling up events from the usercontrols.
> Each event raises up to the host aspx page, which decides what to do,
> what to load etc.
>
> I have to say that this works on a non-ajax environment.
>
> My problem is that, using updatepanels, the result I get is similar to
> a full-postback, everything is updated after an event, even those
> updatepanels I want to keep not up-to-date.
> This, I suppose, is due to the fact that, having to recreate runtime
> usercontrols on page_init (otherwise events are not listened),
> everything is seen as modified and posted back to client. This is what
> I think but maybe I'm wrong.
>
> I tried to do a proof-of-concept of this situation, maybe something is
> missing but reproduces the problem.
>
> I can't attach from this interface, so you can find the zip file on
> following url:
> http://snipurl.com/24sfn
>
> As you can see, even being in separated updatepanels, everything is
> updated on postback
>
> Thanks in advance,
> mt