Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 30th, 2007, 12:33 PM
Authorized User
 
Join Date: Jan 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default deal with "&"

I have a query string and gonna show it's value in both URL and interface.
EX: http://test.com/my.asp?customername=...stomeraddress=... ---URL
    CustomerName:abcd | CustomerAddress:... ---Interface.

Now, my problem is that if a customer's name is bd&ef, I couldn't let it show in the URL, since querystring gonna regard it as 2 values, and the URL won't show up. But If I omit "&" with replace() method, the Interface won't show customername as bd&ef, but bdef, Base on this kind situation, how can I make both side satisfied?

Thank you a lot for your suggestion.



 
Old January 30th, 2007, 01:42 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Magen,

You can use the Server.URLEncode method for this...
Code:
customerName = "bd&ef"
url = "http://test.com/my.asp?customername=" & Server.URLEncode(customerName)
HTH,

Chris

 
Old February 5th, 2007, 07:57 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 198
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via MSN to itHighway
Default

Or you can replace the "&" with "AMPERSAND" and when displaying value again replace "AMPERSAND" to "&"

http://www.ithighway.co.uk/
 
Old February 6th, 2007, 12:09 PM
Authorized User
 
Join Date: Jan 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a bunch for your reply. :)






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to deal with Session? chill06 ASP.NET 2.0 Professional 0 February 22nd, 2007 12:57 PM
Deal with multiple sources Hind XSLT 2 June 5th, 2006 07:16 AM
How to deal with the picture?? CoooooL Pro VB Databases 1 May 3rd, 2005 07:26 AM
Linux & KDE & C++ & QT & MYSQL & Kdevelop Munnnki Linux 0 January 2nd, 2005 05:41 PM
How to deal with relationships? drarem Access 3 July 7th, 2004 07:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.