Nesting UpdatePanel Controls

One UpdatePanel can contain another UpdatePanel. You can nest UpdatePanels to your heart’s content, just like Russian nesting dolls.

Nesting UpdatePanel controls is useful when you want to control how much of a page gets refreshed during an asynchronous postback. Sometimes, you might need to update only a tiny portion of a page, and other times you might need to update the entire page.

For example, the page in Listing 38.6 contains two nested UpdatePanels. The outer UpdatePanel contains a DropDownList, FormView, and ListView control. The inner UpdatePanel contains only the ListView control (see Figure 38.6).

Figure 38.6. Page with nested UpdatePanel controls.

Listing 38.6. NestedUpdatePanels.aspx

When you ...

Get ASP.NET 4 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.