views:

326

answers:

3

HI I have an grid inside an updatePanel. When i select a row in the grid a postback happens. However i donot want to refresh the contents of the updatapanel. Is there anyway to stop the refresh of the contents after the postback completes

thanks

+2  A: 

No. You will have to prevent the postback in the first place. Otherwise you are re-rendering the entire page, including the UpdatePanel. If you really need the server to do some work here, you might try calling a page method instead.

Joel Coehoorn
can i prevent the render of update panel by using any PageRequestManager events
A: 

Yes, setup the AutoPostback property to false in those controls where you don't want this to happen... for example your grid.

Ricardo
i want the postback to happen but no the refresh of the update panel
Ok, have you tried surrounding only the grid with the UpdatePanel... leaving out the rest of the controls in your page? In your original question you said: "However i donot want to refresh the contents of the updatapanel" I am assuming you are talking about other controls in that page. If so, just leave them out of the UpdatePanel.
Ricardo
The grid is the only control in the updatePanel. The grid is firing the event that is causing the postback.
+1  A: 

It depends on what you want to do at selection.

you can set Updatepanel postbackmode to Conditional instead of always.

Pragnesh Patel
My thoughts exactly. You just need to make sure that in your code behind you explicitly tell that UpdatePanel when it needs to update.
Aaron