why cant i use "currency" in querystring!?

L

Lasse Edsvik

can you guys please tell me why i cant use currency as a name in my
querystring?

note: i NEED to use it since i'll be linking to a remote site were they get
that info from querystring

<%
curr="SEK"
%>
<html>
<body>
?a=2&currency=<%=curr%>
</body>
</html>


shows up as:

?a=2¤cy=SEK

wtf?
/Lasse
 
B

Bob Barrows

Lasse said:
can you guys please tell me why i cant use currency as a name in my
querystring?

note: i NEED to use it since i'll be linking to a remote site were
they get that info from querystring

<%
curr="SEK"
%>
<html>
<body>
?a=2&currency=<%=curr%>
</body>
</html>


shows up as:

?a=2¤cy=SEK

wtf?
/Lasse
The problem isn't that you cannot use "currency" in your querystring: the
problem is that the compiler thinks you are trying to use the &curren
character code.

See this article:
http://support.microsoft.com/?kbid=212704

HTH,
Bob Barrows
 
D

Dave Anderson

Lasse Edsvik said:
can you guys please tell me why i cant use currency as a
name in my querystring?

The Entity Sets for HTML 4:
http://www.w3.org/TR/html401/struct/global.html#idx-entity_sets

From the Latin-1 entity (http://www.w3.org/TR/html401/HTMLlat1.ent):

<!ENTITY curren CDATA "¤" -- currency sign, U+00A4 ISOnum -->


... ?a=2&currency=<%=curr%> ...

I think you're up against a browser bug** here, since named entities are
supposed to end with a semicolon. Fortunately, you can get around it by
using:

?a=2&amp;currency=<%=curr%>



**I know, I know -- Microsoft does it this way to accommodate sloppy HTML.
Other browsers are not so forgiving. But that's a two-edged sword, don't you
think?


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
M

Mark Schupp

did you actually test it in a link

The following works fine in IE6, NS4.7, and NS6.2

----TEST.ASP----
<%
curr="SEK"
%>
<html>
<body>
<%="a="&Request.QueryString("a")%><br>
<%="currency="&Request.QueryString("currency")%><br>
<a href="test.asp?a=2&currency=<%=curr%>"> test</a>
</body>
</html>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top