Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Just for completeness...</p> <p>The Gridview renders out a HTML table and while it is accessible by Jquery / Javascript to harvest its data, it is easier to simply create an endpoint within your ASP.NET application that can return JSON data. Here are some approaches, my personal favourite would be jQuery to ASP.NET MVC as you can create a controller to handle and render HTML output and JSON data to same model.</p> <ol> <li>ASP.NET MVC : <a href="http://dotnet.dzone.com/articles/aspnet-mvc-jquery-json" rel="nofollow noreferrer">End to end Jquery</a>, Another example using <a href="http://shashankshetty.wordpress.com/2009/03/04/using-jsonresult-with-jquery-in-aspnet-mvc/" rel="nofollow noreferrer">JsonResult</a> object and a <a href="http://www.codeproject.com/Articles/305308/MVC-Techniques-with-JQuery-JSON-Knockout-and-Cshar" rel="nofollow noreferrer">broader example</a></li> <li>Create a WCF Service. Here you can create a webservice that can run independantly from your website, however, authentication can be a bind when compared to ASP.NET MVC. Examples are from <a href="http://msdn.microsoft.com/en-us/library/bb628607.aspx" rel="nofollow noreferrer">MSDN</a>, using <a href="http://dotnetbyexample.blogspot.com/2008/02/calling-wcf-service-from-javascript.html" rel="nofollow noreferrer">a simple DataContract</a> (that interprets between .NET objects and what should be outputted (lookup Data Transfer Objects [DTO] for further reading). Here's a <a href="http://www.codeproject.com/Articles/33234/A-beginner-s-guide-for-consuming-a-WCF-service-in" rel="nofollow noreferrer">walkthrough</a> as well.</li> <li>Using WebMethod within your code behind. Probably the less impactful for old school ASP.NET developers where you can define methods with the 'Webmethod' attribute that will act as a Javascript Endpoint. It can be a bit fiddly (especially compared to MVC) but may take less time on the implementation. Examples are include <a href="http://www.seoasp.net/post/2008/07/16/jQuery-To-Call-ASPNET-Page-Methods-and-Web-Services.aspx" rel="nofollow noreferrer">simple calls</a> and <a href="http://trentgardner.net/net/asp-net-webmethods-with-jquery-and-ajax/" rel="nofollow noreferrer">this</a> and something a bit <a href="http://weblogs.asp.net/craigshoemaker/archive/2008/11/07/using-jquery-to-call-asp-net-ajax-page-methods-by-example.aspx" rel="nofollow noreferrer">more complex</a>. One thing I would mention is that you do not get any automatic Json serialising (I think) with this technique and you may have to perform the serialisation yourself as shown in this <a href="https://stackoverflow.com/questions/7178839/how-to-pass-a-timespan-object-to-a-wcf-method-using-json">post</a>.</li> </ol> <p>HTH</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload