When JavaScriptSerializer class is required
when we can send data in json format from server side to client side like below code then 

    [WebMethod]
    [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
    public static List<Product> GetItems(int pageIndex, int pageSize)
    {

        List<Product> oProduct = new List<Product> 
        {
           new Product("../images/1.jpg", "Sample Data.1"),
           new Product("../images/2.jpg", "Sample Data.2"),
           new Product("../images/3.jpg", "Sample Data.3"),
           new Product("../images/4.jpg", "Sample Data.4"),
           new Product("../images/5.jpg", "Sample Data.5"),
           new Product("../images/6.jpg", "Sample Data.6"),
           new Product("../images/7.jpg", "Sample Data.7"),
           new Product("../images/8.jpg", "Sample Data.8"),
           new Product("../images/9.jpg", "Sample Data.9"),
           new Product("../images/10.jpg", "Sample Data.10"),
           new Product("../images/11.jpg", "Sample Data.11"),
           new Product("../images/12.jpg", "Sample Data.12"),
           new Product("../images/13.jpg", "Sample Data.13"),
           new Product("../images/14.jpg", "Sample Data.14"),

        };
        return oProduct.GetRange((pageIndex - 1) * pageSize, pageSize);

    }

then why people need to use JavaScriptSerializer class to make data in json format like below code

        JavaScriptSerializer js = new JavaScriptSerializer();

    Person p1 = new Person();

    p1.firstName = "Rakki";

    p1.lastName = "Muthukumar";

    p1.department = "Microsoft PSS";

    p1.address.addressline1 = "Microsoft India GTSC";

    p1.address.addressline2 = "PSS - DSI";

    p1.address.city = "Bangalore";

    p1.address.state = "Karnataka";

    p1.address.country = "India";

    p1.address.pin = 560028;

    p1.technologies = new string[] { "IIS", "ASP.NET", "JavaScript", "AJAX" };

    string str = js.Serialize(p1);

so please discuss the situation when JavaScriptSerializer would be required. thanks

When JavaScriptSerializer class is required
===

when we can send data in json format from server side to client side like below code then 

    [WebMethod]
    [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
    public static List<Product> GetItems(int pageIndex, int pageSize)
    {

        List<Product> oProduct = new List<Product> 
        {
           new Product("../images/1.jpg", "Sample Data.1"),
           new Product("../images/2.jpg", "Sample Data.2"),
           new Product("../images/3.jpg", "Sample Data.3"),
           new Product("../images/4.jpg", "Sample Data.4"),
           new Product("../images/5.jpg", "Sample Data.5"),
           new Product("../images/6.jpg", "Sample Data.6"),
           new Product("../images/7.jpg", "Sample Data.7"),
           new Product("../images/8.jpg", "Sample Data.8"),
           new Product("../images/9.jpg", "Sample Data.9"),
           new Product("../images/10.jpg", "Sample Data.10"),
           new Product("../images/11.jpg", "Sample Data.11"),
           new Product("../images/12.jpg", "Sample Data.12"),
           new Product("../images/13.jpg", "Sample Data.13"),
           new Product("../images/14.jpg", "Sample Data.14"),

        };
        return oProduct.GetRange((pageIndex - 1) * pageSize, pageSize);

    }

then why people need to use JavaScriptSerializer class to make data in json format like below code

        JavaScriptSerializer js = new JavaScriptSerializer();

    Person p1 = new Person();

    p1.firstName = "Rakki";

    p1.lastName = "Muthukumar";

    p1.department = "Microsoft PSS";

    p1.address.addressline1 = "Microsoft India GTSC";

    p1.address.addressline2 = "PSS - DSI";

    p1.address.city = "Bangalore";

    p1.address.state = "Karnataka";

    p1.address.country = "India";

    p1.address.pin = 560028;

    p1.technologies = new string[] { "IIS", "ASP.NET", "JavaScript", "AJAX" };

    string str = js.Serialize(p1);

so please discuss the situation when JavaScriptSerializer would be required. thanks
