From: magix8 on
Hi all,


how can I pass the special characters as request.querystring value ?
example like "&", since & is used in request.querystring for various
parameters value

It will be cut off until "pass" in text 1, for example

let say:
text1 = "I want to pass & chacater"

test.asp?Text1=<%=text1%>

should I use Server.URLEncode ? But Server.URLEncode doesn't seems to
work either as I tried
I read some ppl suggested using replace method to replace "&" with
normal letters, and at receiving, replace back with "&", but is there
a better one ?

Special characters like ' ' and & are having problem in
request.querystring URL

Any suggestions or workaround ?

Thanks.

cheers,
Magix
From: Evertjan. on
magix8(a)gmail.com wrote on 17 feb 2008 in
microsoft.public.inetserver.asp.general:

> how can I pass the special characters as request.querystring value ?
> example like "&", since & is used in request.querystring for various
> parameters value
>
> It will be cut off until "pass" in text 1, for example
>
> let say:
> text1 = "I want to pass & chacater"
>
> test.asp?Text1=<%=text1%>
>
> should I use Server.URLEncode ? But Server.URLEncode doesn't seems to
> work either as I tried
> I read some ppl suggested using replace method to replace "&" with
> normal letters, and at receiving, replace back with "&", but is there
> a better one ?
>
> Special characters like ' ' and & are having problem in
> request.querystring URL
>
> Any suggestions or workaround ?

Use VBS Escape()

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
From: magix8 on
On Feb 17, 5:14 pm, "Evertjan." <exjxw.hannivo...(a)interxnl.net> wrote:
> mag...(a)gmail.com wrote on 17 feb 2008 in
> microsoft.public.inetserver.asp.general:
>
>
>
>
>
> > how can I pass the special characters as request.querystring value ?
> > example like "&", since & is used in request.querystring for various
> > parameters value
>
> > It will be cut off until "pass" in text 1, for example
>
> > let say:
> > text1 = "I want to pass & chacater"
>
> > test.asp?Text1=<%=text1%>
>
> > should I use Server.URLEncode ? But Server.URLEncode doesn't seems to
> > work either as I tried
> > I read some ppl suggested using replace method to replace "&" with
> > normal letters, and at receiving, replace back with "&", but is there
> > a better one ?
>
> > Special characters like ' ' and &  are having problem in
> > request.querystring URL
>
> > Any suggestions or workaround ?
>
> Use VBS Escape()
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)- Hide quoted text -
>
> - Show quoted text -



I used:
<script>

var vQText = document.getElementById("Text1").value;
var result = vQText.replace(/&/gi, "%26"); // replace ampersand
</script>

It works fine.

But for single quote, it doesn't seem working.
i.e var result = vQText.replace(/'/gi, "%27"); // replace single quote

From: Evertjan. on
magix8(a)gmail.com wrote on 17 feb 2008 in
microsoft.public.inetserver.asp.general:

>> > Any suggestions or workaround ?
>>
>> Use VBS Escape()
>>

[please do not quote signatures on usenet]

> I used:
> <script>
>
> var vQText = document.getElementById("Text1").value;
> var result = vQText.replace(/&/gi, "%26"); // replace ampersand
> </script>
>
> It works fine.
>
> But for single quote, it doesn't seem working.
> i.e var result = vQText.replace(/'/gi, "%27"); // replace single quote

Why noy do this serverside as I suggested?

>> text1 = "I want to pass & chacater"
>> test.asp?Text1=<%=text1%>

ASP-VBS:

<% text1 = "I want to pass & chacater" %>

<a href = 'test.asp?Text1=<% = Escape(text1) %>'>

or

ASP-JS:

<% text1 = 'I want to pass & chacater'; %>

<a href = 'test.asp?Text1=<% = escape(text1); %>'>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
From: Daniel Crichton on
magix8(a)gmail.com wrote on Sun, 17 Feb 2008 00:06:55 -0800 (PST):

> Hi all,


> how can I pass the special characters as request.querystring value ?
> example like "&", since & is used in request.querystring for various
> parameters value

> It will be cut off until "pass" in text 1, for example

> let say:
> text1 = "I want to pass & chacater"

> test.asp?Text1=<%=text1%>

> should I use Server.URLEncode ? But Server.URLEncode doesn't seems to
> work either as I tried
> I read some ppl suggested using replace method to replace "&" with
> normal letters, and at receiving, replace back with "&", but is there a
> better one ?

What didn't work with Server.URLEncode?

Response.Write Server.URLEncode("I want to pass & character")

spits out

I+want+to+pass+%26+character

which is correct.

Did you try

test.asp?Text1=<%=Server.URLEncode(text1)%>

--
Dan