how to pass javascript object through url parameter?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nirmalsingh
    New Member
    • Sep 2006
    • 218

    how to pass javascript object through url parameter?

    hi all,
    how to pass javascript object as url parameter and get that object by c#(request.quer ystring..)somet hing like that?
    thanx in advance
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Originally posted by nirmalsingh
    hi all,
    how to pass javascript object as url parameter and get that object by c#(request.quer ystring..)somet hing like that?
    thanx in advance

    What do u mean by javascript object?

    Kind regards,
    Dmjpro.

    Comment

    • nirmalsingh
      New Member
      • Sep 2006
      • 218

      #3
      i feel sending raw strings through url parameter is not safe at all time. so i like to try some object for that string through url parameter. if it is not correct way, plz suggest me any other way to send url parameter hidden or encrypted something like that..
      thanx in advance.

      Comment

      • dmjpro
        Top Contributor
        • Jan 2007
        • 2476

        #4
        Originally posted by nirmalsingh
        i feel sending raw strings through url parameter is not safe at all time. so i like to try some object for that string through url parameter. if it is not correct way, plz suggest me any other way to send url parameter hidden or encrypted something like that..
        thanx in advance.
        Try to submit the form using POST method instead of GET method.
        Right?
        Have a good day.

        Kind regards,
        Dmjpro.

        Comment

        • eranhef
          New Member
          • Jul 2008
          • 1

          #5
          Hi,
          You can do this using Ajax.

          Check this:
          Posted by, Eran Hefer. As you may already know, with Ajax we can easily pass simple or custom object from the server to the client. In this ...


          Eran Hefer.

          Comment

          • vikas251074
            New Member
            • Dec 2007
            • 198

            #6
            Yes you can do this using AJAX technique where parameter is passed as a querystring

            Regards,
            Vikas

            Comment

            • rnd me
              Recognized Expert Contributor
              • Jun 2007
              • 427

              #7
              i prefer passing JSON on the queryString. i can easily pass data to other pages and instantly parse it. i dont have to worry about url encding issues when, for example, passing a full url with queryString as a querystring parameter on an even longer url.

              get params are all strings, json can be any datatype and shape.

              goto json.org and get the json library json2, or .toJSONString, and encodeURICompon ent the result to pass on the queryString . you can eval the decodeURICompon ent version of window.location .search on another page to get your object back, or use a server json parser to grab the data.

              Comment

              Working...