15.02.2015 Views

C# 4 and .NET 4

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1226 ❘ ChaPTer 41 Asp.net feAtures<br />

When the web page appears as shown in<br />

Figure 41 - 14, note that the two render times<br />

shown are the same.<br />

Click the Calculate button to display prime<br />

numbers less than or equal to 2500. Unless you<br />

are running on a slow machine, this should<br />

be almost instantaneous. Note that the render<br />

times are now different — only the one in the<br />

UpdatePanel has changed.<br />

Finally, add some zeros to the maximum value<br />

to introduce a processing delay (about three<br />

more should be enough on a fast PC) <strong>and</strong> click figure 41-14<br />

the Calculate button again. This time, before the<br />

result is displayed, note that the UpdateProgress<br />

control displays a partially transparent feedback message, as shown in Figure 41 - 15.<br />

figure 41-15<br />

While the application updates, the page remains responsive. You can, for example, scroll through the page.<br />

Note that when the update completes, the scroll position of the browser is set to the<br />

point it was at before you clicked Calculate. In most cases, when partial-page updates<br />

are quick to execute, this is great for usability.<br />

Close the browser to return to Visual Studio.<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!