Microsoft recently announced that the Javascript/HTML DOM library jQuery will be integrated into the ASP.NET MVC framework and into ASP.NET / Visual Studio.
What is the best practice or strategy adopting jQuery using ASP.NET 2.0? I’d like to prepare a large, existing ASP.NET Web Application (not MVC) for jQuery. How would I deal with versioning and related issues?
Are the any caveats integrating jQuery and ASP.NET Ajax? Or 3rd party components like Telerik or Intersoft controls?
For me, problems arise when using UpdatePanels and jQuery (no problem with MVC, which doesn’t have a Page Life-Cycle and is truly stateless). For instance, the useful jQuery idiom
used to enhance your DOM or attach events to the DOM elements may not interact very well with the ASP.NET PostBack model if there are UpdatePanels in the page. By now, I circumvent it with the following code snippet
where
gridLoadedwill be the replacement of$(document).ready.I think you have to take extra care and know very well the ASP.NET Page/Controls Life-Cycle in order to mix both technologies.