I'm the sole developer of our website, which uses Kentico CMS and allows me to develop in
ASP.Net and C#. I do my best to keep up with the latest trends and to do things the "correct" way, so as we set to rebuild our current site, I was wondering if everyone could give me advice.
One of the goals of our rebuild is to remove all ASP.Net UpdatePanels. They've caused us a lot of trouble and tend to be burdensome. I want to rely on jQuery's AJAX interface instead.
I'm familiar with creating WebService methods to handle AJAX calls. Our main call returns a JSON string which contains all the page data like the Page Title, any Content Regions HTML, and the Breadcrumb HTML.
Since we make use of Repeaters and such throughout our site to display data, I found a method online to render Controls server-side and return their HTML in the JSON string.
I guess I'm wondering if that's the best means to accomplish this. Since various data is displayed in different ways, it's easiest to use a Repeater and Transformation combo to generate the proper HTML of the data.
I guess my concern is that I've read that only data should be returned in the JSON string, not formatted HTML, but that seems burdensome since JavaScript doesn't have a way to use Transformations and Repeaters like ASP does. Add in the fact that our CMS is
type-driven with custom transformations.
Anyway, I hope that makes sense. I'd appreciate any feedback anyone has on what I've stated and would be happy to clarify anything.
airic82
Member
78 Points
223 Posts
Trying to Use ASP.Net AJAX with jQuery the "Right" Way
Dec 30, 2012 02:49 PM|LINK
Hey, everyone:
I'm the sole developer of our website, which uses Kentico CMS and allows me to develop in ASP.Net and C#. I do my best to keep up with the latest trends and to do things the "correct" way, so as we set to rebuild our current site, I was wondering if everyone could give me advice.
One of the goals of our rebuild is to remove all ASP.Net UpdatePanels. They've caused us a lot of trouble and tend to be burdensome. I want to rely on jQuery's AJAX interface instead.
I'm familiar with creating WebService methods to handle AJAX calls. Our main call returns a JSON string which contains all the page data like the Page Title, any Content Regions HTML, and the Breadcrumb HTML.
Since we make use of Repeaters and such throughout our site to display data, I found a method online to render Controls server-side and return their HTML in the JSON string.
I guess I'm wondering if that's the best means to accomplish this. Since various data is displayed in different ways, it's easiest to use a Repeater and Transformation combo to generate the proper HTML of the data.
I guess my concern is that I've read that only data should be returned in the JSON string, not formatted HTML, but that seems burdensome since JavaScript doesn't have a way to use Transformations and Repeaters like ASP does. Add in the fact that our CMS is type-driven with custom transformations.
Anyway, I hope that makes sense. I'd appreciate any feedback anyone has on what I've stated and would be happy to clarify anything.
Thanks!
-Eric Rovtar
chetan.sarod...
All-Star
65749 Points
11148 Posts
Re: Trying to Use ASP.Net AJAX with jQuery the "Right" Way
Jan 01, 2013 08:34 AM|LINK
Refer this
http://www.codeproject.com/Articles/17203/Using-jQuery-for-AJAX-in-ASP-NET
http://encosia.com/using-jquery-to-directly-call-aspnet-ajax-page-methods/
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.