Error when Iterating a Serialized C# class with javascript
I'm having problems while iterating a List in a json object with javascript. I have a C# class, and I serialize it with JavascriptSerializer. However, when I try to iterate the json object accessing its fields, I keep getting the 'undefined' error.

This is the class:

    public class PaginationHelper
    {
            public int displayedItems{get;set};
            public int itemsLeft{get;set};
            public List<object> objectList;
            public int pagesLeft{get;set};
            public int pageNumber{get;set};
            public int maxItems{get;set};
            public int collectionSize{get;set};
    
            //Methods I need........
    }

This is the method returning Json Object:
            //Previous piece of code........
        

PaginationHelper ph = new PaginationHelper(MAX_ITEMS, cityList.Count);
        
        return Json(ph.ToJSON(), JsonRequestBehavior.AllowGet);

I'm using an extension method that's why there's a ToJSON() call.

Thanks in advanced!

Jorge
Error when Iterating a Serialized C# class with javascript
===

I'm having problems while iterating a List in a json object with javascript. I have a C# class, and I serialize it with JavascriptSerializer. However, when I try to iterate the json object accessing its fields, I keep getting the 'undefined' error.

This is the class:

    public class PaginationHelper
    {
            public int displayedItems{get;set};
            public int itemsLeft{get;set};
            public List<object> objectList;
            public int pagesLeft{get;set};
            public int pageNumber{get;set};
            public int maxItems{get;set};
            public int collectionSize{get;set};
    
            //Methods I need........
    }

This is the method returning Json Object:
            //Previous piece of code........
        

PaginationHelper ph = new PaginationHelper(MAX_ITEMS, cityList.Count);
        
        return Json(ph.ToJSON(), JsonRequestBehavior.AllowGet);

I'm using an extension method that's why there's a ToJSON() call.

Thanks in advanced!

Jorge