Jul 2, 2015 11:49
Use this code
Jul 2, 2015 11:48
public class OutputJson
{
public List<Entity> Android { get; set; }
}
public class Entity
{
public string Name { get; set; }
public string Version { get; set; }
}

public class Newclass {

public string GetJson()
{
var outputJson = new OutputJson()
{
Android = new List<Entity>
{
new Entity { Name = "aaa", Version = "123"},
new Entity { Name = "bb", Version = "34"},
new Entity { Name = "cc", Version = "56"},
}
};
JavaScriptSerializer serializer = new JavaScriptSerializer();
string Jsonstring = serializer.Serialize(outputJson);
Jul 2, 2015 11:41
?
Jul 2, 2015 11:41
Can you send me your code file
Jul 2, 2015 09:56
please try this code in your web config
Jul 2, 2015 09:56
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
<system.webServer>
<httpErrors errorMode="DetailedLocalOnly" defaultResponseMode="File">
<remove statusCode="404" subStatusCode="2" />
<error statusCode="404" subStatusCode="2" prefixLanguageFilePath="" path="ennai.com/index.asp&quot;" responseMode="Redirect" />
</httpErrors>

</system.webServer>
</configuration>
Jul 2, 2015 09:53
Which error you are getting?
Jul 2, 2015 09:44
Can you paste the web config code?
Jul 2, 2015 09:44
Download web.config file from ftp then open it there will be <system.web> Add <customErrors mode="Off"> inside the <system.web> and after that you can get the exact error
Jul 2, 2015 09:44
use outputJson insted of entity . I have mentioned it according to my example
Jul 2, 2015 09:44
and please add <customErrors mode="Off"> in <system.web> the case if you the different error
Jul 2, 2015 09:44
var output = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(outputJson); Replace your code with JavaScriptSerializer serializer = new JavaScriptSerializer(); string Jsonstring = serializer.Serialize(entity);