javascript - how to send json data to serializable class -


There is a problem when sending json data for the serial class. This is true when I check data on the browser on the client side, but on the server side, the field of serialized class is zero.

Client side (using dojo): ticket object is assigned to debugger line field

  var ticket = {product ID: product ID, type: ticket Type}; DataService.xhrPageMethodJson ("API / Tickets / MyTickets", dojo.toJson (ticket), {Success: Function (Data) {Debugger LoadShoot Page (getRoot ("help / ticket.spacks? Mode = list"));}, Error: Function (mistake) {LoadingOverlay.hide ();}}};   

Web method: Ticket on this method. Product ID, Ticket The default value or zero in the typed field [AcceptVerbs ("POST") [Actionemem ("mitits")] [Authorized] Public Zero Mititensus ([Body] Ticket Ticket) {Datatile Mitrix = DB Ticket. My ticket (globals logon user .username id, ticket.product id, ticket type); WebContacts Session ["ticket"] = myTickets; } ; Set; } Public string theme {get; Set; } Public string message {get; Set; } Receive the public date time {date; Set; } [JOINFIELD (typef (user), "id")] public int sender user ID {received; Set; } [Jonfield (typef (product), "id")] get public productivity product; Set; } [Joyfield (typef (ticket import level), "ID")] Public Entry Import Level {Received; Set; } Public int analysis {get; Set; } Public int SolutionTransactionId {get; Set; } [Joyfieldfield (typef (ticket type), "ID")] {Received Public Entity Type; Set; } Public Completion Status {Receipt; Set; } Public Entous Associated User ID {Receipt; Set; } Public Name Score {get; Set; }}

I solve this problem by marking properties as data subscribers and Data is done with class as contract. Here I am sharing a new class structure: [Serialable] [DataContract] [EntityTable (name = "ticket")] Public class ticket: unit {[datamember] Public override int ID ( get receive); Set; } [Datamember] public string theme {get; Set; } [Datamember] public string message {get; Set; } [DateMaker] {Date Received Public Date Time; Set; } [JOINFIELD (typef (user), "id")] [datamember] public int sender user ID {received; Set; } [JOINFIELD (typef (product), "id")] [datamember] public int product ID {get; Set; } [Joyfieldfield (typef (ticket import level), "id")] [datamember] Public Int'l level level {get; Set; } [Datamember] public int analysis {get; Set; } [Datamember] mass int Solution TransId {Received; Set; } [Joyfieldfield (typef (ticket type), "id")] [datamember] public ent type {get; Set; } [Datamember] get public uncertainty status { Set; } [Datamember] Public Int. Associated UserID {Received; Set; } [Datamember] Public float score {get; Set; }}

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -