Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery UI + ASP.NET UpdatePanel - Is it worth it?

I really like the looks of jQuery UI and I'd love to integrate it into my ASP.NET Web Applications. I like the themes and how easy it is to use the widgets. I'm currently using AJAX Control Toolkit controls like the Calendar and ModalPopup. I'm hoping to replace them with the DatePicker and Dialog widgets, but I hear they have issues with UpdatePanels. There are workarounds for these issues, but I wonder, is it worth it?

Which leads into my question(s):

  • Has anyone had luck using jQuery UI widgets exclusively (instead of AJAX Toolkit Controls) in an ASP.NET Web Application that occasionally uses UpdatePanels?
  • Are there any best practice resources for getting jQuery UI and UpdatePanels to play nice?

Update: Based on the answers so far, it seems that the best thing to do is replace UpdatePanels with $.ajax and PageMethods. That should allow me to use jQuery UI without any issues and also improve my AJAX performance.

like image 987
jrummell Avatar asked Oct 22 '09 18:10

jrummell


3 Answers

No, it's not worth it. If the toolkit's calendar and modalpopup extenders are working for you, then just hold on to them.

In future projects, stay away from asp.net ajax and use jQuery exclusively. This way you wont run into any of the updatepanel problems. ASP.NET 4.0 Webforms are going to make using jQuery much easier in the past, because you will have more control of how controls get named when they are rendered to HTML.

like image 60
Ronnie Overby Avatar answered Nov 13 '22 02:11

Ronnie Overby


We use Microsoft AJAX (only using UpdatePanels) and jQuery and all works great.

Using UpdatePanels makes all UserControls, Postbacks, Viewstate etc work as you would expect with the UI enhancements of jQuery. There are a few things to learn in getting them to work together and until we find an alternative we will continue to do this. We think its worth it.

I would be keen to see how UpdatePanels can be easily replaced with jQuery, but I expect one would need to write additional code for each UpdatePanel replacement, rather than letting asp.net handle things? Are there any articles out there that demonstrate replacing UpdatePanels that contain asp.net controls and UserControls with events etc?

like image 33
Mark Redman Avatar answered Nov 13 '22 00:11

Mark Redman


I'm working on a project with a lot of UpdatePanel and jQuery, things just work fine.

Yes, it is a period when you need to learn, to make things work.

If you have a lot of UpdatePanels and you don't want to remove them then this is understandable, and using jQuery is just improving the UI, so it's not going to much worse.

Also jQuery has functionalitys related to AJAX,so you can make elegant client side coding with jQuery which is not related to Design and ui stuff.

I think if you search for jQuery and Ajax on the internet you will find a bunch of good examples, and fine techniques to both technologies together.

PS:

  • Remenber that UpdatePanel is evil in sort of way when you are using in an inappropriate way.

  • UpdatePanel is (and generally AJAX) is very customizable, make time for yourself to optimize it

Good luck!

like image 1
Zoltan Veres Avatar answered Nov 13 '22 00:11

Zoltan Veres