Sunday, March 11, 2012

UpdatePanel Cancel Postback

It kind ofis the point. Delayed loading is so that the user has something to look at immediately until the rest of the page loads, not so that the user can just up and leave before the page loads. And technically, control is not returned to the client until all of the server-side code is completed (unless you're working with asynchronous calls to pagemethods, or webservices, or whatnot).

I suppose if you wanted to break out, you would just have to cancel the postback that is in progress.


What do you think the is the best way to get the effect I'm looking for? It seems calling pagemethods in javascript that point to some webservices would do the trick. I guess I need to research more about them.


Canceling an async postback

http://mattberseth.com/blog/2007/06/aspnet_ajax_canceling_an_async_1.html

Delay Load an UpdatePanel

http://mattberseth.com/blog/2007/07/delay_load_an_updatepanel.html


I've seen articles on canceling async postbacks, but you have to explicityly call the method. If I have a bunch of links on the page I would have to have each one call the cancel method when they're clicked. I want something more like the default internet explorer behavior where you can just stop the loading of a page with any request for a new page. It's looking more and more like this isn't possible with the updatepanel.


Try using Response.Redirect(url, True) in the link button's click event instead of specifying a postbackurl (if that's what you're doing). The second parameter, when set to True, indicates that execution of the current page should be terminated.


Well, I'm trying to avoid having to code something for every link on the page. The reason is that we use various master pages, menus , etc.. so every link in all of these pages and controls would all have to do this. It may be my only solution, but it seems like there should be a better way.

No comments:

Post a Comment