URL in a querysting?

Discussion in 'ASP .Net' started by JJ, May 11, 2007.

  1. JJ

    JJ Guest

    Is there a way to include a url in a querysting?

    JJ
     
    JJ, May 11, 2007
    #1
    1. Advertising

  2. JJ

    JJ Guest

    Sorry - there doesn't seem to be any problem with doing this - my error was
    something else.

    JJ
    "JJ" <> wrote in message
    news:%...
    > Is there a way to include a url in a querysting?
    >
    > JJ
    >
     
    JJ, May 11, 2007
    #2
    1. Advertising

  3. JJ

    Rob Meade Guest

    "JJ" wrote ...

    > Sorry - there doesn't seem to be any problem with doing this - my error
    > was something else.


    You're probably already doing it - but you need to watch for the &'s in it,
    especially if the URL you want to put in the querystring has its own
    querystring etc...

    For example...

    http://www.your-domain.com?url=http...eviouspage=default.asp&userid=10&redirect=yes

    In the above, redirect=yes might be part of the first querystring, but could
    easily be included in the second, or vice-versa...

    Just thought it worth mentioning...

    Cheers

    Rob
     
    Rob Meade, May 11, 2007
    #3
  4. JJ

    JJ Guest

    Good point didn't think of that.

    How would you deal with the '&'s ?

    Perhaps replace them with another character, or surround the url in some
    sort of marker character perhaps?

    Thanks,

    JJ

    "Rob Meade" <> wrote in message
    news:%...
    > "JJ" wrote ...
    >
    >> Sorry - there doesn't seem to be any problem with doing this - my error
    >> was something else.

    >
    > You're probably already doing it - but you need to watch for the &'s in
    > it, especially if the URL you want to put in the querystring has its own
    > querystring etc...
    >
    > For example...
    >
    > http://www.your-domain.com?url=http...eviouspage=default.asp&userid=10&redirect=yes
    >
    > In the above, redirect=yes might be part of the first querystring, but
    > could easily be included in the second, or vice-versa...
    >
    > Just thought it worth mentioning...
    >
    > Cheers
    >
    > Rob
    >
     
    JJ, May 11, 2007
    #4
  5. JJ

    David Guest

    urlencode the url in the parameter. That should convert your & to &amp;


    --
    Best regards,
    Dave Colliver.
    http://www.AshfieldFOCUS.com
    ~~
    http://www.FOCUSPortals.com - Local franchises available



    "JJ" <> wrote in message
    news:...
    > Good point didn't think of that.
    >
    > How would you deal with the '&'s ?
    >
    > Perhaps replace them with another character, or surround the url in some
    > sort of marker character perhaps?
    >
    > Thanks,
    >
    > JJ
    >
    > "Rob Meade" <> wrote in message
    > news:%...
    >> "JJ" wrote ...
    >>
    >>> Sorry - there doesn't seem to be any problem with doing this - my error
    >>> was something else.

    >>
    >> You're probably already doing it - but you need to watch for the &'s in
    >> it, especially if the URL you want to put in the querystring has its own
    >> querystring etc...
    >>
    >> For example...
    >>
    >> http://www.your-domain.com?url=http...eviouspage=default.asp&userid=10&redirect=yes
    >>
    >> In the above, redirect=yes might be part of the first querystring, but
    >> could easily be included in the second, or vice-versa...
    >>
    >> Just thought it worth mentioning...
    >>
    >> Cheers
    >>
    >> Rob
    >>

    >
    >
     
    David, May 11, 2007
    #5
  6. JJ

    JJ Guest

    Just as I was testing that very solution! - Thanks David.

    JJ

    "David" <> wrote in message
    news:%...
    > urlencode the url in the parameter. That should convert your & to &amp;
    >
    >
    > --
    > Best regards,
    > Dave Colliver.
    > http://www.AshfieldFOCUS.com
    > ~~
    > http://www.FOCUSPortals.com - Local franchises available
    >
    >
    >
    > "JJ" <> wrote in message
    > news:...
    >> Good point didn't think of that.
    >>
    >> How would you deal with the '&'s ?
    >>
    >> Perhaps replace them with another character, or surround the url in some
    >> sort of marker character perhaps?
    >>
    >> Thanks,
    >>
    >> JJ
    >>
    >> "Rob Meade" <> wrote in message
    >> news:%...
    >>> "JJ" wrote ...
    >>>
    >>>> Sorry - there doesn't seem to be any problem with doing this - my error
    >>>> was something else.
    >>>
    >>> You're probably already doing it - but you need to watch for the &'s in
    >>> it, especially if the URL you want to put in the querystring has its own
    >>> querystring etc...
    >>>
    >>> For example...
    >>>
    >>> http://www.your-domain.com?url=http...eviouspage=default.asp&userid=10&redirect=yes
    >>>
    >>> In the above, redirect=yes might be part of the first querystring, but
    >>> could easily be included in the second, or vice-versa...
    >>>
    >>> Just thought it worth mentioning...
    >>>
    >>> Cheers
    >>>
    >>> Rob
    >>>

    >>
    >>

    >
    >
     
    JJ, May 11, 2007
    #6
  7. David wrote:
    > urlencode the url in the parameter. That should convert your & to &amp;


    No, it should convert & to %24.

    &amp; is the html code for &.

    --
    Göran Andersson
    _____
    http://www.guffa.com
     
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Aug 9, 2007
    #7
    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. Doug
    Replies:
    0
    Views:
    514
  2. Jon paugh
    Replies:
    1
    Views:
    861
  3. wl
    Replies:
    1
    Views:
    4,454
  4. Just D.
    Replies:
    0
    Views:
    503
    Just D.
    Aug 11, 2004
  5. Jules
    Replies:
    12
    Views:
    189
    Julian Rickards
    Oct 7, 2003
Loading...

Share This Page