Hi, I am developing an asp.net web application and stand on jQuery plug-ins for any aspects of my Interface. But unfortunately I have to use AJAX only for its UpdatePanel to enable partial rendering. Is there any way to use jQuery for partial rendering and act such an UpdatePanel?
A:
No, there isn't.
UpdatePanel is intimately tied with ASP.Net's rendering engine and ViewState; it cannot be replicated with jQuery.
However, you could replace your UpdatePanel with simple AJAX and ASHX handlers. (Unless you use ASP.Net web controls)
SLaks
2010-06-06 19:42:06
You right SLaks, but nothing is imposible in the programming. Is this so hard to make a button for example send a request to server and retrive answer, then display it on a page? If so, I should give up :(
Mehdi
2010-06-06 19:49:14
That's what I meant by simple AJAX.
SLaks
2010-06-06 19:51:51
@Mehdi: This isn't a web limitation, but rather ASP.Net's pipeline you're fighting, this is a prime example where MVC makes what you're doing much easier/more lightweight.
Nick Craver
2010-06-06 20:10:09
I've never tried it, but off-hand I would have guessed you could use jQuery's ajax to do a full post-back call (it'll look that way to the asp.net side, or at least it should) and then take the result, filter it down to just the div (for instance) you want, and then swap the existing dom's version for the new one. I haven't looked at UpdatePanel's source, but that was my understanding of what it did (the important part being the server just sees it as a full post-back), and off-hand I guess I don't understand why you couldn't take this approach. If it won't work, I'd like to learn why not :)
James Manning
2010-06-07 01:13:50
BTW, there's certainly lots of additional logic in UpdatePanel specifically (for instance, if the response includes redirects), so I'm not saying this will work as a generic UpdatePanel equivalent, but for the simple case of updating a chunk of the DOM, it seems at least potentially viable :)
James Manning
2010-06-07 01:15:14
That doesn't do any good. The point of UpdatePanel is that it's not a full postback.
SLaks
2010-06-07 01:20:32
Thanks a lot for your advise Nick, also many thanks to James for recommending a solution, but I'm looking for an easy to use solution that let me encapsulate it as a server-side control and use it instead of UpdatePanel. And also I am agree to SLaks; we don't want a full post-back at all. Any ideas yet?
Mehdi
2010-06-07 07:02:36
What's wrong with UpdatePanel? It will be extremely difficult to replicate it yourself.
SLaks
2010-06-07 20:28:38