0

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.

http://pastebin.com/JT7V7Bd1

Please find aspx.cs Code :

http: // pastebin . com/BU9TtpqK

and Entity Framework class : 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.

If there are anything missing please let me know.

Thanks in advance.

1 Answer 1

1

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).

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.

Otherwise, you can create a separate set of classes to use as data transfer objects (dto).

Sign up to request clarification or add additional context in comments.

3 Comments

I have shared my Entity Framework, and its relational.So you mean to say I need to create same class with same properties at Controller level ?
Relational isn't the issue, I'm telling you that you have circular navigation properties (which is absolutely fine, btw), and that these properties don't work well with serialization. Picture the serializer looping through the properties. If you can get to AgentInfo from AgentAddress, and vice versa, how does the serializer no when to stop?
No luck , you please change in file on pastebin ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.