Showing posts with label trigger. Show all posts
Showing posts with label trigger. Show all posts

Monday, March 26, 2012

Determining the source of a partial rendering postback

Is there a way to determine (on the server) what trigger/control/event was the source of the postback? How about something that indicates what update panel(s) will be rendered?

I see that the script manager has an IsInAsyncPostBack property, but I'm curious if there is something more specific.

UpdatePanel.IsInPartialRendering does not seem to work.

You could check the _EventTarget for a hint on what triggered the PostBack.

What would you do differently if you knew what triggered the PostBack?


You could use the ScriptManager.AsyncPostBackSourceElementID to determine the source of the asynchronous postback. In terms of what UpdatePanels will get updated, in server code I don't think there is a summary list that lists them because the Update() method can be called by any code and tracking that is difficult if not impossible(?). However, on the client you can use the pageLoaded or pageLoading events of the PageRequestManager to get information about what panels will be created, updated or deleted.

Wednesday, March 21, 2012

Degradable ajax

A pure hypotetical question.

Suppose I have an updatepanel with say a datagrid inside and it has a trigger relates
to another submit button. How can you make it degradeable? Have you heared any future
possibilty?

I am not sure it exactly addresses your question, but our goal with UpdatePanel is for it to be a no-op on browsers that don't support XmlHttp... so you should be able to easily degrade to a full postback model... is that what you were asking?

..brad


yeah, sorry for not being clear. that's exactly what i meant. thanks.