Monday, March 26, 2012

Preventing an UpdatePanel rendering after a Postback

Hi Everyone,

I have a page with three UpdatePanels, let's call them A, B and C and I have a control in B (a webgrid from ComponentArt) which issues a postback when one of it's rows is selected. What I would like to happen is for that event to be processed on the server, however I only want C to update its display (because in B, that row in the grid automatically changes it's appearance, so there is no need for the grid to be redrawn). Do you know if this is possible, ie to switch off the normally-useful behaviour of Atlas always refreshing the UpdatePanel containing the control that triggered the postback.

Thanks for any helpSmile [:)]

Rob.

Try insert Mode=Conditional in the Properties of UpdatePanel.

Bye.


Thanks for replying Paulo, however the mode is already set to "Conditional" for all of the UpdatePanels.


Sorry, but I don't think it's really possible.

You can cause 'C' to update by calling the Update method on that UpdatePanel in code behind, but if 'B' is causing the postback due to an event firing within it, 'B' is going to either force a full postback if its not in an UpdatePanel or a partial postback if its contained within an UpdatePanel.

The only idea I have is to change from the postback occurring on a row selected to a JavaScript command or something like tied to the onclick event to change the appearance of the row and then click a hidden button through JavaScript or something like that to cause 'C' to postback.

A partial postback is a lot like a regular postback and there's a difference in the parameter of the Render methods that determines what Html is sent back down to the browser.(Check out my blog posting on the subject.)

- Joel

I think this could be helpful (http://forums.asp.net/thread/1266249.aspx). I don't know if it's really what are you looking for but try it. I had a similar problem. I wanted to update panel B when I click on control in update panel A. The solution described in the thread works (and is very simple).

Pavel

No comments:

Post a Comment