URL Decode HTML encoded in JavaScript

Discussion in 'ASP .Net' started by Ben Amada, Sep 30, 2005.

  1. Ben Amada

    Ben Amada Guest

    Hello. I have some HTML that I would like to pass to a popup webform via a
    querystring. I've run into some problems which I believe is because I need
    to encode the HTML. The popup webform is being created via JavaScript so I
    need to use JavaScript to encode the HTML. The problem is that I'm not sure
    if the URLDecode function in .NET is fully compatible with the encoding
    function in JavaScript.

    I found the following two JavaScript encoding functions:

    escape(param)
    encodeURI(param)

    I'm leaning towards using encodeURI as it is a newer, and probably more
    reliable function. Has anyone used the encodeURI function before with
    ..NET's URLDecode function? Do they work well with each other??

    TIA,
    Ben
    Ben Amada, Sep 30, 2005
    #1
    1. Advertising

  2. Ben Amada

    Ben Amada Guest

    Ben Amada wrote:

    > escape(param)
    > encodeURI(param)
    >
    > I'm leaning towards using encodeURI as it is a newer, and probably more
    > reliable function.


    After some more testing, it seems as though the 'escape' function works
    better. Specifically with a # sign, encodeURI doesn't encode it at all
    which is giving me problems. 'escape', on the other hand, properly encodes
    the # to %23.

    So I guess my question now is, is .NET's URLDecode function fully compatible
    with JavaScript's 'escape' function? Is anyone else using anything else
    besides 'escape' that they've found works better?

    Thanks once again,
    Ben
    Ben Amada, Sep 30, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dotan Cohen
    Replies:
    0
    Views:
    96
    Dotan Cohen
    Jun 13, 2013
  2. Robert Kern
    Replies:
    0
    Views:
    95
    Robert Kern
    Jun 13, 2013
  3. Dotan Cohen
    Replies:
    0
    Views:
    92
    Dotan Cohen
    Jun 13, 2013
  4. Robert Kern
    Replies:
    0
    Views:
    102
    Robert Kern
    Jun 13, 2013
  5. Dotan Cohen
    Replies:
    0
    Views:
    105
    Dotan Cohen
    Jun 13, 2013
Loading...

Share This Page