Partial Page Rendering Using Hidden IFrame
Partial page rendering removes the need for the entire Web page to be refreshed as the result of a postback. Instead, only individual regions of the page that have changed are updated, speeding up user interaction with the Web site.
Developers who want to add such behaviors to their Web pages are often faced with a difficult decision. All of these actions can be implemented using a simple solution: by refreshing the entire page in response to the user interaction. However, this solution is easy but not always desirable. The full page refresh can be slow, giving the user the impression that the application is unresponsive.
Web pages typically support a variety of actions, such as entering and submitting form data and navigating to different pages. Many Web pages also support another type of action, which allows the user to make modifications to the contents of the Web page itself without navigating to a different page. Some examples of such actions include clicking on a link to update an image on the same page. For example, an automobile configuration application might update an image of a car as the user chooses different options, such as the preferred color.
Selecting an item from a choice box might result in modifications to other fields on the same page. For example, selecting a car make might update the set of available car models displayed. Clicking a link or selecting an item from a choice could be used to scroll to a new page of data in a table. Clicking a button in a table might add a new row to the table. All of these actions are similar in that they result in the same page being re-rendered in a slightly different state. Ideally, these changes should be implemented as seamlessly as possible, so that the user doesn't experience a loss of context which could distract from the task at hand.
Page Elements That May Change During PPR
Page Elements That Do Not Change During PPR
Some page elements are always associated with a page, regardless of the content displayed. As a rule of thumb, elements above the page title (except message boxes) remain constant and don't change position, whereas elements in footer are constant but may move up or down the page to accommodate changes to page content. The following elements never change when PPR is initiated:
In most cases the following elements don't change, other than moving up or down the page to accommodate changed elements. Nevertheless, in certain cases actions on the page may require them to be redrawn:
In the above scenarios this solution can be used to achieve good performance and user interaction with the Web pages.
Contexts in Which PPR Should Not Be Used
When PPR is implemented correctly, it significantly improves application performance. When performance improvement isn't possible, it shouldn't be implemented, thus avoiding unnecessary code bloat; PPR cant be used when navigating to another page (with a different title).