diff --git a/Ashx/CargaEventos.ashx b/Ashx/CargaEventos.ashx index cce796c97..dab9d8862 100644 --- a/Ashx/CargaEventos.ashx +++ b/Ashx/CargaEventos.ashx @@ -112,12 +112,25 @@ Public Class CargaEventos : Implements IHttpHandler, IRequiresSessionState FI = context.Request("start").ToDate FF = context.Request("end").ToDate - If Not GetContratos(context:=context) Then - 'Convierte el objeto de Eventos en JSON - 'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer - Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events) + If Not GetContratos(context:=context) Then + 'Convierte el objeto de Eventos en JSON + 'Dim oSerializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer + + + 'Dim settings As New Newtonsoft.Json.JsonSerializerSettings With { + ' .NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ' .Formatting = Newtonsoft.Json.Formatting.None + ' } + 'Dim sJSON As String = Newtonsoft.Json.JsonConvert.SerializeObject(events, settings) + 'context.Response.Write(sJSON) + + Dim serializer As New Newtonsoft.Json.JsonSerializer() + Using writer As New IO.StringWriter() + serializer.Serialize(writer, events) + context.Response.Write(writer.ToString()) + End Using + - context.Response.Write(sJSON) End If End If Exit Select