Passing data to asp.net page method from jQuery is failing
<p>This jQuery call keeps failing with the following error messeage: <code>"Cannot convert object of type 'System.String' to type 'System.Collections.Generic.IDictionary</code>2[System.String,System.Object]'"`</p>

<p>The jQuery:</p>

<pre><code>$('input, select').blur(function ()
                {
                    var categoryId = $('#IncidentCategoryEnhancedDropDownList').val();
                    var latitude = $('#LatitudeHidden').val();
                    var longitude = $('#LongitudeHidden').val();
                    var dateTime = $('#DateEnhancedTextBox').val();

                    if (categoryId == '--Select--')
                    {
                        return;
                    }

                    if (!latitude.length || !longitude.length)
                    {
                        return;
                    }

                    if (!dateTime.length)
                    {
                        return;
                    }

                    $.ajax({
                        type: "POST",
                        url: "ReportIncident.aspx/GetIncidentsNearBy",
                        data: $.toJSON('{categoryId:"' + categoryId + '",latitude:' + latitude + ',longitude:' + longitude + ',dateTime:"' + dateTime + '"}'),
                        contentType: "application/json; charset=utf-8",
                        dataType: "json",
                        success: function (msg)
                        {
                            console.log(msg.d);
                            // $("#Result").text(msg.d);
                        }

                    });
                });
</code></pre>

<p>The page method:</p>

<pre><code> [WebMethod]
        public static IList&lt;IncidentDTO&gt; GetIncidentsNearBy(int categoryId, float latitude, float longitude, DateTime dateTime)
        {
            var incidents = new MendixIncidentDAO().GetIncidents()
                .Where(i =&gt; i.IncidentTypeId == categoryId)
                .Where(i =&gt; i.Date &gt;= dateTime.AddHours(-1) &amp;&amp; i.Date &lt;= dateTime.AddHours(1))
                .Where(
                    i =&gt;
                    SpatialHelpers.DistanceBetweenPlaces((double) longitude, (double) latitude, (double) i.Longitude,
                                                         (double) i.Latitude) &lt; 1)
                .Select(
                    i =&gt;
                    new IncidentDTO
                        {
                            Id = i.IncidentId,
                            IncidentCategory = i.IncidentType,
                            Address = i.Address,
                            FormattedDate = i.FormattedDate
                        });
            return incidents.ToList();
        }
</code></pre>
