Hemant Kumar

Hemant Kumar

  • NA
  • 2.3k
  • 490k

How to read the JSON file in the Folder using jQuery in ASP.NET?

Jul 23 2012 2:19 AM
Hi All,


Can any one help me about How to read the JSON file in a Folder using jQuery?

I have tried like this but always my cursor going to the Failure Method.

var urlJSON = '<%=ResolveUrl("example.json") %>';
       $(document).ready(function () {
           $('#btnLoad').click(function () {
               $.ajax({
                   url: urlJSON,
                   dataType: "json",
                   type: "POST",
                   contentType: "application/json;charset=utf-8",
                   success: AjaxSucceeded,
                   error: AjaxFailed
               });
           });
       });
 
       function AjaxSucceeded(result) {
           alert(result.d);
       }
       function AjaxFailed(result) {
           alert(result.status + ' ' + result.statusText);
       }