-
Problem using QueryString with ampersand in a link variable...
Hello,
I have a link
<a href="mypage.asp?f=<%=first%>&s=<%=sec%>">Donalds</a>
where first and second is defined like
<%
first = "Donald & Co"
sec = "2"
%>
When I use Querystring in mypage.asp to fetch the variables it looks like
this:
f=request.querystring("f")
s=request.querystring("s")
but when I look at the variables they just look like
f=Donald
s=
i e I have lost the information after my ampersand..
How come??
-
Re: Problem using QueryString with ampersand in a link variable...
Try this:
<a href="mypage.asp?f=<%=first%>" & "&s=<%=sec%>">Donalds</a>
"Siri" <siri.svedberg@capgemini.se> wrote:
>
>Hello,
>I have a link
><a href="mypage.asp?f=<%=first%>&s=<%=sec%>">Donalds</a>
>where first and second is defined like
><%
>first = "Donald & Co"
>sec = "2"
>%>
>
>When I use Querystring in mypage.asp to fetch the variables it looks like
>this:
>f=request.querystring("f")
>s=request.querystring("s")
>
>but when I look at the variables they just look like
>
>f=Donald
>s=
>
>i e I have lost the information after my ampersand..
>How come??
>
>
>
>
-
Re: Problem using QueryString with ampersand in a link variable...
Try using the Server.URLEncode() function.
-
Re: Problem using QueryString with ampersand in a link variable...
Siri,
John is close but that will not work
if you are using it within a resopnse.write or redirect then you need this
varURL = "Mypage.asp?f=" & first & "&S=" & Second & ">Donalds</A>"
Response.write varURL
if you want to switch contents then it would look like
<a href="mypage.asp?f=<%=first%>&s=<%=sec%>">Donalds</a>
I would suggest that you keep switching contents to a minimum there is to
much processing switching back and forth.
Thanks
Reza
"john" <jluciano@twtr.com> wrote:
>
>Try this:
>
><a href="mypage.asp?f=<%=first%>" & "&s=<%=sec%>">Donalds</a>
>
>
>"Siri" <siri.svedberg@capgemini.se> wrote:
>>
>>Hello,
>>I have a link
>><a href="mypage.asp?f=<%=first%>&s=<%=sec%>">Donalds</a>
>>where first and second is defined like
>><%
>>first = "Donald & Co"
>>sec = "2"
>>%>
>>
>>When I use Querystring in mypage.asp to fetch the variables it looks like
>>this:
>>f=request.querystring("f")
>>s=request.querystring("s")
>>
>>but when I look at the variables they just look like
>>
>>f=Donald
>>s=
>>
>>i e I have lost the information after my ampersand..
>>How come??
>>
>>
>>
>>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|