Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,155,226 members, 7,825,881 topics. Date: Monday, 13 May 2024 at 04:38 AM

Tutorial: How To Return Html In Json Response Using Asp.net And Jquery - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Tutorial: How To Return Html In Json Response Using Asp.net And Jquery (5952 Views)

List Of All States With Local Governments In Nigeria In JSON, PHP And SQL Format / How Do I Create An API For A Website Or Blog In JSON Format. / Asp.net And Php Which Is Better (2) (3) (4)

(1) (Reply)

Tutorial: How To Return Html In Json Response Using Asp.net And Jquery by Syma: 1:42am On Nov 01, 2010
I just blogged on how to write a generic jquery function to handle ajax request that return html in json response. It's a good trick that I believe will find its way in your code library.

What I blogged about in this post is how to return html content in json response type. The useful thing about this technique is that you get to write your html once in a partial view, which you can then render using full page or ajax request, you can also use the same ajax request with different unrelated url that returned different types. This saves you from writing too many codes for different kind of request and reduces view duplication between server and client side.

The final result

[img]http://1.bp..com/_xtoz_qjBJqk/TM3Ohod-DqI/AAAAAAAAAA4/yylH_MZc1E0/s1600/return-html-as-json.jpg[/img]

You can read the blog and download the source code here http://emekaemego..com/2010/11/how-to-return-html-in-json-response.html
Re: Tutorial: How To Return Html In Json Response Using Asp.net And Jquery by Nobody: 7:44am On Nov 01, 2010
Dude i really Like your articles as it ignites my interest in .NET,
Re: Tutorial: How To Return Html In Json Response Using Asp.net And Jquery by Syma: 9:19pm On Nov 01, 2010
@pc guru
Thanks, I really want to be posting more frequently, but I'm finding it hard to squeeze our time.
I'm on new one now, will post it when am done.

(1) (Reply)

Help Needed On API Used To Generate Wema Bank Virtual Accounts / I Want To Be Developing .jar Aps For Nokia Phones. Where Do I Start?developing .jar Mobile Apps What / ALERT: Nairaland Declared Insecure | Loophole found

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.