2012年3月26日月曜日

Response.Redirect from UpdatePanel causes full refresh

I noticed that when I redirect to another page from within an update panel, the page fully refreshes (may be that's by design?).

How can I prevent this from happening?

Thanks.

you can not prevent this, this is the way any web sites works. When you say response.redirect, you are instructing the browser to make a fresh call to particular aspx page.


rmaiya:

you can not prevent this, this is the way any web sites works. When you say response.redirect, you are instructing the browser to make a fresh call to particular aspx page.

that is right.

If you are trying to only update the panel then try something like, updatePanel1.update();, or if you want to load a new page inside the panel try putting an iframe inside the panel


What is considered as best practice?

For example, if you click on the above links (such as "Learn", "Downloads", "Ajax"...) on this page, how do they ensure that that the header and footer elements of the page don't "blink"?


As they are different pages, I do want to do a response.redirect to keep the URL's friendly, but at the same time, I would like my header and other static elements not refresh each time. Do they use partial page caching to achieve this?

0 件のコメント:

コメントを投稿