0
Answer

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

Hemant Kumar

Hemant Kumar

12y
1.2k
1
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);
       }