Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

Url and querystring reading

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David C - 04 Apr 2008 20:17 GMT
I have an asp.net page that sends a querystring to a new web page (see full
url below).  The querystring takes a filename as one of the parameters.  The
problem I am having is when the filename contains a "&" then when I read the
querystring it doesn't read past the embedded "&".  Any way around this?
Thanks.
David

http://server/Fileroom/frmSubfolder.aspx?fn=90216&seq=9&sname=Quarles%20&%20Brady%20(Misc./No%20File%20#)

The value in the sname querystring is "Quarles & Brady (Misc./No File #)"
PopeDarren@gmail.com - 04 Apr 2008 20:37 GMT
I haven't had to do this since I wrote classic asp... When I had this
problem back then I wrote my own little encoder and decoder, which is
really simple if you think you'll only have a problem with that one
little bitty character.  Something like:

myStr = myStr.replace("&", "$A$M$P")

Then on the next page:

myStr = Request("fileName").ToString.Replace("$A$M$P", "&")

Or you could use the encrypter and decrypter.  I haven't used that,
but it looks like there is some good info here:

http://www.devcity.net/Articles/47/1/encrypt_querystring.aspx
http://forums.asp.net/t/989552.aspx
David Wier - 04 Apr 2008 21:53 GMT
Check out this article concerning URLEncode:
http://www.codeproject.com/KB/aspnet/QueryString.aspx

David Wier
http://aspnet101.com
http://iWritePro.com - One click PDF, convert .doc/.rtf/.txt to HTML with no
bloated markup

>I have an asp.net page that sends a querystring to a new web page (see full
>url below).  The querystring takes a filename as one of the parameters.
[quoted text clipped - 6 lines]
>
> The value in the sname querystring is "Quarles & Brady (Misc./No File #)"
bruce barker - 04 Apr 2008 22:17 GMT
all querystring args are supposed to be urlencoded. see:

  HttpUtility.UrlEncode

-- bruce (sqlwork.com)

> I have an asp.net page that sends a querystring to a new web page (see full
> url below).  The querystring takes a filename as one of the parameters.  The
[quoted text clipped - 6 lines]
>
> The value in the sname querystring is "Quarles & Brady (Misc./No File #)"
PopeDarren@gmail.com - 04 Apr 2008 22:41 GMT
Sweet.  Thanks Bruce!
David C - 05 Apr 2008 18:10 GMT
Thank you all.  I knew there had to be a simple solution.
David
>I have an asp.net page that sends a querystring to a new web page (see full
>url below).  The querystring takes a filename as one of the parameters.
[quoted text clipped - 6 lines]
>
> The value in the sname querystring is "Quarles & Brady (Misc./No File #)"

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.