Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • sudeer 24 posts 42 karma points
    Jul 27, 2011 @ 13:51
    sudeer
    0

    Sending Json Object to server side using base methods ??

    Hi, can any one help me how to send the Json object to the server side method using /base methods. my code is given below

     $.get("/base/Dragdropcontrols/StoreDragDropDetails/" + jsonobject + ".aspx", function (data) {
                    alert('Data Loaded');
                });

    the "jsonobject" contains the below value

    ["{\"UserId\" - \"0\",\"ControlId\" - \"ContentPlaceHolderDefault_RunwayMasterContentPlaceHolder_BULegend_9_pnlDragableWindow\",\"OrderNumber\" - \"0\",\"IsMinimized\" - \"block\" }"]

    In the above code if i remove the jsonobject and send just only string i.e.

     $.get("/base/Dragdropcontrols/StoreDragDropDetails/ TestSample.aspx", function (data) {
                    alert('Data Loaded');
                });

     

    then it works, but not with json object.

    Please let me know is there is a way to send the json object to server side. also is there any limitation sending the string value to server side ???

     

     

     

     

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Jul 29, 2011 @ 12:21
    Bo Damgaard Mortensen
    0

    Hi sudeer,

    Have you had a look at jQuery.post()? :-)

    http://api.jquery.com/jQuery.post/

    With this you should be able to post your json to the server.

    About the length of querystring: this varies from browser to browser. In IE you should generally follow the old restriction from 1996 that says 255 bytes. For new browsers it's another story, Firefox can handle up to 4000 bytes if needed. 

    Using POST you will not need to think of these restrictions as the data is sent in the header rather than in the URL itself. The limit on POST is by default up to 2mb on IIS4.

    Hope this sheds some light on sending data from the client to the server :-)

Please Sign in or register to post replies

Write your reply to:

Draft