jscript serialize returns null when website hosted on server

santosh.y
 
on Jan 13, 2016 08:17 AM
2720 Views

when application runs on local machine, it returns data correct, but when website hosted on server then it cannot retunrs data in jscript serialize

C#
JavaScriptSerializer jscript = new JavaScriptSerializer();
List<ListItem> items= new List<ListItem>();
return jscript.Serialize(items); 
Javascript
var jsdata = JSON.parse(items);

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download
Shashikant
 
on Jan 13, 2016 08:21 AM
on Jan 14, 2016 01:48 AM

Hi,

I think server not returing any data,try to get data in another way and check if return data is null

Please refer below article and check

Populate (Bind) ASP.Net ListBox using jQuery AJAX and JSON in C# and VB.Net