【发布时间】:2014-04-29 03:23:09
【问题描述】:
我想在服务器端使用 JSON 字符串化数组 ::
已发送字符串化数据的格式为::
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 格式如下::
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; }
}
【问题讨论】:
-
把你的 ui 也设置为它看起来没问题你是否使用 jquery ajax 请求传递?如果是这样,则存储到cookie中,然后在服务器端访问它.....
标签: jquery asp.net-mvc json asp.net-mvc-3 list