jQWidgets Forums

jQuery UI Widgets Forums Grid send variables to server using formatdata

This topic contains 0 replies, has 1 voice, and was last updated by  naatha 12 years, 2 months ago.

Viewing 1 post (of 1 total)
  • Author

  • naatha
    Member

    Hello;

    In my grid program, I pass string to server using the following code:

    		
    var x = "25";
    var source =
    {
    datatype: "json",
    type: 'GET',
    url: 'MyPage.aspx/GetJsonData',
    formatdata: function () {
    return { s: x }
    },
    cache: false,
    datafields:
    [
    { name: 'FirstName', type: 'string' },
    { name: 'LastName', type: 'string' }
    ]
    };

    In the server side, i am getting the string using:

    		
    [WebMethod]
    [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
    public static Object GetJsonData(string s)
    {
    //Code using s
    }

    it works fine when i pass x = “59” or x = “2384219852598435”

    but i want to pass some letters as well, like x = “12@qryq-weqr-uo234-iu34”, but when i try, i keep getting errors.

    is there any way i can pass some string with letters ?

    is it possible to pass more than one variables?

    thanks

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.