在服务器端访问JSON字符串化数据

时间:2014-04-29 03:23:09

标签: jquery asp.net-mvc json asp.net-mvc-3 list

我想在服务器端使用JSON字符串化数组::

已发送字符串化数据的FOrmat是::

task:[{"TaskID":4,"OwnerID":1,"RecurrenceID":null,"Title":"Test Title1234","Description":"Desc... ","Start":"2014-04-28T01:00:00.000Z","End":"2014-04-30T06:00:00.000Z","RecurrenceRule":"","RecurrenceException":"Task Exception Occured","IsAllDay":false}]

在服务器端,我尝试访问的是::

public virtual JsonResult Test_UpdateSchedule(IList<SchedulerViewModel> task)
{
//Implementation Code
}

但我无法在此处访问它。

我的ViewModel的FOrmat如下::

 public class SchedulerViewModel 
    {
        public int TaskID { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public DateTime Start{get;set;}
        public DateTime End{get;set;}
        public string RecurrenceRule { get; set; }
        public int? RecurrenceID { get; set; }
        public string RecurrenceException { get; set; }
        public bool IsAllDay { get; set; }
        public int? OwnerID { get; set; }
        public string StartTimezone { get; set; }
        public string EndTimezone { get; set; }

    }

1 个答案:

答案 0 :(得分:0)

确保您的请求是POST,并且您的内容类型为application/json

如果您发布了可能有助于我们回答的数据的传递方式。