Click here to Skip to main content
15,893,508 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
This thread is similar to the one at Could not call a WebMthod with parameters[^]. The related codes are below:
JavaScript
var e = document.getElementById('DropDownRouteID');
var routeById = e.options[e.selectedIndex].text;
var mA = document.getElementById('MeasureA').value;
var mB = document.getElementById('MeasureB').value;
$.ajax( {
    type:'Get',
    url: 'SOEDefaultB2.aspx/GetData2',
    dataType: 'text',
    data: JSON.stringify({routeById: routeById, mA: mA, mB: mB}),
    contentType: 'application/json; charset=utf-8',
    crossDomain : true,
    success:function(results) {
        console.log('Success!');
        debugger;
        ajaxData = results;   },
    error: function(xhr, status, error) {
        debugger; console.log(error); }
});

C#
 public static string[][] GetData2(string route, string mA, string mB) {
...  }

The error in the error:function shows 'Internal Server Error'. Please hint me where the error can be debugged. Thanks in adavnce.
Posted
Comments
Sandip.Nascar 10-Jan-14 13:53pm    
It seems, some excetion occurred in GetData2 method.
Can you debug the method and identify the issue?
[no name] 10-Jan-14 14:03pm    
Did not hit GetData2() at all. I change dataType:'json', and got the same result: Internal Server Error. Any additional hint? Thanks.

1 solution

I think you have circular dependencies issue. Simply remove the circular references. If you can not then have a look at:
http://www.asp.net/web-api/overview/formats-and-model-binding/json-and-xml-serialization#handling_circular_object_references[^]
 
Share this answer
 
Comments
[no name] 13-Jan-14 8:25am    
Used an alternative solution to avoid this problem. Thanks.
[no name] 13-Jan-14 9:18am    
Glad this worked for you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900