Request.QueryString and "&" in Folder Name

E

EoRaptor013

Not sure where to ask this question, but...
I'm using a TreeView component to enable browsing file folders in a
specific directory (for test purposes /Program Files/). Some users use
an ampersand ("&") in both folder and file names. This has caused me
some real grief! I'm not in a position to tell the users it's an ID 10
T error and they have to change their file and folder names.
In VS2K5, I have debugged my code and found that

sender.base.Request.QueryString =
{dir=%2fProgram+Files%2fMom+&amp%3b+Pop%2f}

and

sender.base.Request.RawURL="/popups/share_directory/XmlFromFileSystem.aspx?dir=/Program%20Files/Mom%20&%20Pop/"

These results reflecting a file folder /Program Files/Mom & Pop/

However, the code line:

sdir = Request.QueryString["dir"]

gives me /Program Files/Mom (space after Mom is included). In other
words, everything from the ampersand on, including the ampersand, is
truncated. The "&amp%3b" you see in the QueryString is my attempt to
escape the ampersand. I've also tried /& to no avail.

At this point, the boss thinks I'm a loser! Any help would be greatly
appreciated!
Asp.NET 2.0, VS 2005.
Randy
 

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,792
Messages
2,569,639
Members
45,353
Latest member
RogerDoger

Latest Threads

Top