locked
Ajax calling WebService How Transfer a ref parameter? RRS feed

  • Question

  • Hello friends:

    I want to say first that my english is very poor, i'm so sorry.

    (1) webservice code of part of function

    public string GetHello(ref int age)

    (2) html code 

    $.ajax({
                type: 'POST',
                contentType: 'application/json',
                url: 'http://localhost:64849/WebInfo.asmx/GetHello',
                data: '{ age : 37 }',
                dataType: 'json',
                success: function (result) {
                    alert(result.d);
                }
    });

    -----------------------------------------------

    called result return message like at "Message: "type of “System.Int32” can't cast to “System.Int32&”"" ExceptionType:"System.InvalidOperationException

    -----------------------------------------------

    My question : how transfer a ref parameter to the webservice using ajax

    Anyway, thank you.

    Wednesday, October 12, 2016 11:39 AM