473,320 Members | 1,939 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

# character in querystring

When passing the '#' character as part of a querstring value, the received
Querystring value gets truncated just prior to the '#' character.

Exmple:

string s = "someColor=#0000FF";
On the receiving side, a zero-length string is received.

string s = "someColor=TestThis#0000FF";
On the receiving side, only "TestThis" is received (the #0000FF has been
lost).

Just for fun, I used HTMLEncode() on this and it has no effect on the #
character (still drops it and everything that follows).

What can I do about this? I need to receive the # character and everything
that follows - via Querystring.

Thanks.
Nov 18 '05 #1
6 2498
On Mon, 9 Aug 2004 13:08:05 -0700, "Guadala Harry" <GM**@NoSpam.com>
wrote:
When passing the '#' character as part of a querstring value, the received
Querystring value gets truncated just prior to the '#' character.

Exmple:

string s = "someColor=#0000FF";
On the receiving side, a zero-length string is received.

string s = "someColor=TestThis#0000FF";
On the receiving side, only "TestThis" is received (the #0000FF has been
lost).

Just for fun, I used HTMLEncode() on this and it has no effect on the #
character (still drops it and everything that follows).

What can I do about this? I need to receive the # character and everything
that follows - via Querystring.

Thanks.


# is used in urls for anchors. try another character?

-Adam
Nov 18 '05 #2
>>> # is used in urls for anchors. try another character? <<<
# is also used as part of the hex definition of a color (e.g., #0000FF gives
you blue).

I guess I'll have to substitute something else for # in my case here unless
someone else has any other ideas..

Thanks.
Nov 18 '05 #3
> # is also used as part of the hex definition of a color (e.g., #0000FF
gives
you blue).
# is reserved in the context of a URI. You're referring to it being reserved
in the context of HTML/CSS.
I guess I'll have to substitute something else for # in my case here unless someone else has any other ideas..


Well, in a URL, anything after # is considered an anchor name, so, you can't
pass it as part of a string AFAIK.

What are you ultimately trying to do? If you're just passing a hex value,
I'd just pass the numbers:

?hex=999999

then, before you use them just append the # in your asp.net code.

-Darrel
Nov 18 '05 #4
"Guadala Harry" <GM**@NoSpam.com> wrote in news:u53PDykfEHA.1644
@tk2msftngp13.phx.gbl:
Just for fun, I used HTMLEncode() on this and it has no effect on the #
character (still drops it and everything that follows).


Use URLEncode.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #5
>>>What are you ultimately trying to do?<<<<

Basically this is an academic exercise in which I'm trying to duplicate some
of the functionality commonly found in various online CSS tutorials in which
you can pick a color (or other style property), click a refresh button, and
then see the effect elsewhere in the page.

I'm open to other ideas, but for now I'm doing this with framesets in which
I show a "preview" area in one page/frameset, and accept user css style
preferences in another page/frameset. From settings in one frame I style the
page in another frame. The way I pass the style info between the framesets
is via QueryString (thus the need to pass hex color information via
Querystring).

-G

Nov 18 '05 #6
use UrlEncode with querystrings, which will translate it to %23

-- bruce (sqlwork.com)
"Guadala Harry" <GM**@NoSpam.com> wrote in message
news:u5**************@tk2msftngp13.phx.gbl...
When passing the '#' character as part of a querstring value, the received
Querystring value gets truncated just prior to the '#' character.

Exmple:

string s = "someColor=#0000FF";
On the receiving side, a zero-length string is received.

string s = "someColor=TestThis#0000FF";
On the receiving side, only "TestThis" is received (the #0000FF has been
lost).

Just for fun, I used HTMLEncode() on this and it has no effect on the #
character (still drops it and everything that follows).

What can I do about this? I need to receive the # character and everything
that follows - via Querystring.

Thanks.

Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Fawke101 | last post by:
Hi there, I have a ASP/SQL 7 application that displays data from various SQL7 Views onto a ASP page. A column of this data is displayed in ASP as hyperlinks and the relevent data is put into...
1
by: lion | last post by:
my Problem: a query string passed into a html page doesn't display correctly on a mac I am just using html and javascript (no ASP, PHP or server side scripting) This is the query string:...
2
by: Harley | last post by:
im working on an ASP.NET app in VB.NET and have problems with foreign characters. everything works ok, special characters are presented ok onscreen when typed in the body of the page, using html...
4
by: Raterus | last post by:
Howdy, Simple question, but I can't figure out how to do it. I have a a page which is called initially with a querystring. After I get the querystring values, I don't need the querystring to...
12
by: Alex | last post by:
I have a question about determining if one QueryString keys exists. The idea is, if this key exists, than its presence is enough to indicate that its value is true. For example ... ...
3
by: Dan Sikorsky | last post by:
How can I get the Querystring passed to the Referring Page from its referrer? I don't want the querystring coming to my current page. I want the querystring that came to the referring page, so...
3
by: Dariusz Tomon | last post by:
Hi My problem is like that: I'm trying to pass values branza and jezyk in querysting: http://localhost/euroadres/pokazbranza.aspx?branza=transport lotniczy&jezyk=1 Branza is type...
1
by: adrian.besimi | last post by:
Hi, I got a serious problem regarding the Server.Execute and/or Server.Transfer. Here's the idea of my application: I have 1 web page named Default.aspx where I execute all my other pages.
3
by: pingsheng | last post by:
Dear all, I have a form with dynamically created input fields. These fields go to next page for submitting into SQL database. The thing is all fields are the same but 4 fields. So each record...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.