-
Notifications
You must be signed in to change notification settings - Fork 22
ajax默认form表单提交,导致实体不识别
曾璐 edited this page Apr 14, 2017
·
1 revision
出现位置:实体比较复杂,包含List之类的时候
public class AdvertisementType
{
/// <summary>
/// 广告位名称
/// </summary>
[Required]
public string AdvertisementName { get; set; }
/// <summary>
/// 图片的导航属性 此处会出现
/// </summary>
public List<AdvertisementImage> AdvertisementImages { get; set; }
}
解决方案:
(1)前端创建好object之后,先序列化为json字符串,再传字符串到后端,可解析
(2)后端以string接收参数后,手动反序列化