Query string in asp page

Ask a Question related to ASP, Design and Development.

  1. #1

    Default Query string in asp page

    In asp how How can i pass a parameter value with a space in the value

    like this

    test.asp?catalog=aValue&lineitem=ladies cloths

    I get a %20 as a space in the browser window,
    Regards
    Don


    Don Grover Guest

  2. Similar Questions and Discussions

    1. query string
      hi there, i'm working on a very simple flash data integration project, i have been trying to send a query string without opening/reloading a...
    2. Maintain query string and somehow auto refresh a pagewith that string intact
      I have a drill down where on page one the user selects criteria to narrow down the search for a speicific group of employees(like all hired between...
    3. Using NOT LIKE in Query String????
      OK, I know how to use to pull up all records that contains the keyword, but what about not containing the keyword? I've tried NOT LIKE but i get ...
    4. Query String - encrypt
      All, I often use a querystring in my ASP pages. for example: if val > 1 then Response.redirect "val1.asp?val=1&user=UserID End if Is there a...
    5. Quick String Query...
      I have been using PHP for a while now, although my knowledge of the inbuilt functions is pretty lacking. I am trying to remove a 'space' from the...
  3. #2

    Default Re: Query string in asp page

    Don,

    Usually the %20 doesn't cause problems for me, but if you have to keep the
    space, you might try:

    <%
    query = request.querystring("query")
    query = Replace(query, "%20", " ")
    response.write query
    %>
    <a href="test.asp?query=my name">Click me</a>

    The replace function here removes any '%20' it finds and replaces it with a
    space

    Hope this helps.

    Gram


    Gram Guest

  4. #3

    Default Re: Query string in asp page

    Gram wrote:
    [snip replace function]
    > The replace function here removes any '%20' it finds and replaces it with a
    > space
    This won't work due to the nature of the HTTP standard (should be
    somewhere within RFC 2616).
    Because a http query string cannot contain spaces within a request
    (blanks are userd as separators f.ex. "GET index.html") they are being
    replaced by your browser automatically. Therefore some kind of
    server-sided replace function will not work - and even should not work.
    However, your webserver knows about this and replaces all %20 with
    spaces so you can access your variables again with spaces instead of %20.

    This does affect other special characteres as well. There is a
    server-function that you can use to encrypt a string before processing
    your document to the client: Server.HTMLencode (SomeString)

    Kai Boenke Guest

  5. #4

    Default Re: Query string in asp page

    Or Server.URLEncode(SomeString)

    Ray at home

    "Kai Boenke" <kai.boenke@de.bosch.com> wrote in message
    news:bmoag2$436$1@ns2.fe.internet.bosch.com...
    > Gram wrote:
    > [snip replace function]
    > > The replace function here removes any '%20' it finds and replaces it
    with a
    > > space
    >
    > This won't work due to the nature of the HTTP standard (should be
    > somewhere within RFC 2616).
    > Because a http query string cannot contain spaces within a request
    > (blanks are userd as separators f.ex. "GET index.html") they are being
    > replaced by your browser automatically. Therefore some kind of
    > server-sided replace function will not work - and even should not work.
    > However, your webserver knows about this and replaces all %20 with
    > spaces so you can access your variables again with spaces instead of %20.
    >
    > This does affect other special characteres as well. There is a
    > server-function that you can use to encrypt a string before processing
    > your document to the client: Server.HTMLencode (SomeString)
    >

    Ray at Guest

  6. #5

    Default Re: Query string in asp page

    Ray at <%=sLocation%> wrote:
    > Or Server.URLEncode(SomeString)
    >
    > "Kai Boenke" <kai.boenke@de.bosch.com> wrote in message
    > news:bmoag2$436$1@ns2.fe.internet.bosch.com...
    >> [snip other stuff]
    >>This does affect other special characteres as well. There is a
    >>server-function that you can use to encrypt a string before processing
    >>your document to the client: Server.HTMLencode (SomeString)
    You are right.
    "Server.HTMLencode (SomeString)" actually does something different (not
    completely but useless in this case): Converting characters to HTML
    entities.

    Kai Boenke Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139