JsonserializationException- error due converting data

  1. #1

    JsonserializationException- error due converting data

    Hi..

    I'm getting the JsonserializationException "Error coverting value "" to type 'System.Integer'". I'm passing #{storeCandDetail}.getChangedData() from the client side to server side,so I'm passing that string to the method on server side:

    public void SaveRecord(string changedCandData)
            {
                    StoreDataHandler sdh = new Ext.Net.StoreDataHandler("{"+changedCandData+"}");        
                    Ext.Net.ChangeRecords<Business.Entities.Cand> messagesCand = sdh.ObjectData<Business.Entities.Cand>(); 
                    foreach (Business.Entities.Cand cnd in messagesCand .Updated)
                    {
                        cnd.Save();
                    }
            }
    The exception appears on Ext.Net.ChangeRecords<Business.Entities.Cand> messages = sdh.ObjectData<Business.Entities.Cand>(). I know this is happening because the object doesn't contain all valid type of data and doesn't contain all required properties Cand object need to have. But, I'm not sure how to check this? Is there a way to do some conversions before making messagesCand type in my SaveRecord method?

    Thanks,
    Aleks (the new guy in ext.net) :)
    Last edited by geoffrey.mcgill; Sep 14, 2011 at 4:25 PM. Reason: please use [CODE] tags
  2. #2
    Hi,

    Please try to set DefaultValue="0" for the Int RecordField.
    <ext:RecordField Name="test" Type="Int" DefaultValue="0" />

Similar Threads

  1. [CLOSED] Dynamically added Ext.Net.Image not converting '~/'
    By SouthDeveloper in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 31, 2011, 7:28 AM
  2. Replies: 5
    Last Post: Jun 08, 2010, 5:11 AM
  3. Replies: 4
    Last Post: May 21, 2009, 12:50 PM
  4. HtmlEditor Display different after converting on the start
    By speedstepmem2 in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Apr 02, 2009, 9:13 AM
  5. Replies: 0
    Last Post: Oct 11, 2008, 10:40 AM

Posting Permissions