Sunday, March 13, 2011

How to prevent asp.net UpdatePanel to prevent doing post backs from a custom control

Scenario: 
How to prevent asp.net UpdatePanel to prevent doing post backs from a custom control?

Explanation:
Asp.net UpdatePanel is primarily used for performing asynchronous postbacks with partial page updates. After adding an UpdatePanel control to your page, you can achieve a partial-update of your page on a postback. Only the content in the UpdatePanel is refreshed, the other parts of the page remain unchanged.

You may experience scenarios when controls that are placed inside an UpdatePanel cause the whole page to raise a post back.

Resolution:
Each control inside the update panel need to have an id assigned. After all the controls inside the update panel are assigned ids, the controls inside the UpdatePanel wont cause the page to raise post backs anymore.

No comments:

Post a Comment