The earlier you learn how and why ASP requires and uses what is called the
"variant data type" the earlier you learn that the answers you have been
given may work but they are sloppy hacks and not the best to learn from and
the earlier the lightbulb(s) will light up helping you to internalize the
insights you will need to excel at ASP scripting.
' Mike's MD Webs...
Note that the variant data type required and used by ASP does not require
instantiating and initializing another object simply to pass a URL to the
Response object. Doing so imposed a penalty on the performance of your page.
Never use objects when they are not needed. That is, there was no need to
pass the URL to the Server object using its UrlEncode function. Furthermore,
try not to adopt Mike's coding style.
' poor convention and sloppy VBScript formatting...
Response.redirect
server.URLEncode("
https://www.anchoragerescue.org/Donation_Credit_Card.htm")
' better convention using Pascal Case with correct VBScript formatting...
Response.Write( Server.UrlEncode("
https://.... ") )
Rowe's example is even worse as it is relies on a sloppy hack. Just because
browsers have been developed to parse just about any slop amateurs throw at
the browser is not a reason to justify doing so. Customers, employers and
business partners have wised up. Slooppy coders cost them money imposing
their bad habits which cost money to maintain and update when that money is
better spent on wiser pursuits. Microsoft has announced for example that IE7
is clamping down on the slopsters and has developed IE7 so it will not parse
feeds that are not well formed.
Now after all that criticism is said and done all that you needed to do was
escape the URL using quotation marks as this following use case will prove
by simply putting the use case into an .asp file and requesting the file in
the browser.
<%
' best convention using Pascal Case with correct formatting...
Response.Redirect("
https://partnering.one.microsoft.com/mcp/")
%>
Again, you should search for and learn about the "variant data type" which
will really help make it easier to understand how ASP functions. Work on
adopting an acceptable set of naming conventions and learn how to discipline
yourself to format your code correctly. It becomes critically important
when scripting with JavaScript and more advanced pursuits.
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL
http://clintongallagher.metromilwaukee.com/