I have a problem when set a custom javascript Converter. At the moment
of replacing the resulting object exists but the value not. The
converter asigns well the js code in order to instance the result but
the value property of the result is null.

<jsonConverters>
       <remove type="AjaxPro.DataRowConverter,AjaxPro.2" />
       <add
type="esanchezfo.Tool.Web.Ajax.DataRowConverter,esanchezfo.Tool.Web" />
       <add
type="esanchezfo.Tool.Web.Ajax.EnumConverter,esanchezfo.Tool.Web"
/>
</jsonConverters>

The datarow converter that i use is a little modification of the
default one changing the serialize method:

public override string Serialize (object o)
{
       StringBuilder sb;

       DataRow row;

       bool b;


       if(!(o is DataRow)) { throw new NotSupportedException (); }

       sb = new StringBuilder();

       row = (DataRow) o;

       b = true;

       sb.Append ("{");

       foreach (DataColumn column in row.Table.Columns)
       {
               if (b){ b = false; }
               else { sb.Append (","); }

               sb.Append (string.Format ("{0}:{1}",
JavaScriptSerializer.Serialize
(column.ColumnName), JavaScriptSerializer.Serialize (row [column])));
       }

       sb.Append ("}");

       return sb.ToString ();
}

This has a resulting object with datarow columns as properties and its
corresponding values of properties as the value foreach column.

{ColA:ValA, ColB:ValB}

Please give us an example in order to avoid problems integrating custom
converters, and if is possible a little guide or tutorial in order to
know more about the code and tools related with this converters.

Thanks.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info/

Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
-~----------~----~----~----~------~----~------~--~---

Reply via email to