简体   繁体   English

不支持数组反序列化:C#Jquery

[英]Is not supported for deserialization of an array : C# Jquery

I have single page , contains all information about agent. 我只有一页,其中包含有关代理的所有信息。 So I differentiate data into Tabs. 因此,我将数据分为制表符。 All information are linked with each other. 所有信息都相互链接。

please find below aspx design code. 请在下面找到aspx设计代码。

http://pastebin.com/JT7V7Bd1 http://pastebin.com/JT7V7Bd1

Please find aspx.cs Code : 请找到aspx.cs代码:

http: // pastebin . http:// pastebin。 com/BU9TtpqK com / BU9TtpqK

and Entity Framework class : http://pastebin.com/di3fqJ6H 和实体框架类: http//pastebin.com/di3fqJ6H

I tried a lot to overcome Deserializaion error. 我做了很多尝试来克服反序列化错误。 anyone please try to run code at your end , and please correct me . 任何人都请尝试在您的末端运行代码,并请纠正我。 I am trying to send json object to aspx using jquery and will parse to different table object and then save record. 我正在尝试使用jquery将json对象发送到aspx,并将解析到其他表对象,然后保存记录。

If there are anything missing please let me know. 如果有什么遗漏,请告诉我。

Thanks in advance. 提前致谢。

The issue here is likely that the serialization can't handle the circular references in the navigation properties of your model classes. 这里的问题很可能是序列化无法处理模型类的导航属性中的循环引用。 (eg, you can do AgentInfo.AgentAddress.AgentInfo ad infinitum). (例如,您可以无限地做AgentInfo.AgentAddress.AgentInfo广告)。

The simplest solution is that if you don't need them, remove the navigation properties from your model classes that are causing circular references. 最简单的解决方案是,如果不需要它们,请从引起循环引用的模型类中删除导航属性。 Eg, If you don't need to get to the AgentInfo from the agent address, remove it. 例如,如果您不需要从座席地址AgentInfo ,请将其删除。

Otherwise, you can create a separate set of classes to use as data transfer objects (dto). 否则,您可以创建一组单独的类以用作数据传输对象(dto)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM