473,386 Members | 1,832 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,386 software developers and data experts.

building a URL dynamically and URLEncode?

I am having trouble building a URL the serves up an image
dynamically...something involving the & separating my URL parameters. If I
put the same URL in with & instead of the code-generated &, everything
is fine. I've tried URLEncode and URLDecode in both directions and no dice.
hELP!

'declare and build the URL
Dim theURL As String = ""
theURL = sServerName & _
sPath & _
"servicename=" & sServiceName & _
"&a=" & sRequest & _
"&b=" & sWidth & _
"&c=" & sHeight & _
"&d=" & sFormat & _
"&e=" & sLayers & _
"&f=" & sWmtVer & _
"&g=" & sSrs & _
"&h=" & sBbox

'Set the image's url and alt tag
imgWrsiHome.ImageUrl = HttpUtility.UrlDecode(theURL)
http://theserver.com?servicename=r4&...G:4326&h=5

_____
DC G
Nov 21 '05 #1
1 1115
DC Gringo,

&amp isn't URL Encoding, it is HTML Encoding. Somehow you are encoding it
that way. You can always attempt a URLDecode on the receiving end in case
anything is automatically encoded. I don't see in your code there how that
is happening. Can you post additional code that shows the entire link being
created and displayed?

Thanks,
Ian Suttle
http://www.IanSuttle.com

"DC Gringo" wrote:
I am having trouble building a URL the serves up an image
dynamically...something involving the & separating my URL parameters. If I
put the same URL in with & instead of the code-generated &, everything
is fine. I've tried URLEncode and URLDecode in both directions and no dice.
hELP!

'declare and build the URL
Dim theURL As String = ""
theURL = sServerName & _
sPath & _
"servicename=" & sServiceName & _
"&a=" & sRequest & _
"&b=" & sWidth & _
"&c=" & sHeight & _
"&d=" & sFormat & _
"&e=" & sLayers & _
"&f=" & sWmtVer & _
"&g=" & sSrs & _
"&h=" & sBbox

'Set the image's url and alt tag
imgWrsiHome.ImageUrl = HttpUtility.UrlDecode(theURL)
http://theserver.com?servicename=r4&...=EPSG:4326&h=5

_____
DC G

Nov 21 '05 #2

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

Similar topics

1
by: shank | last post by:
http://www.mydomain.com/customer.asp?po=1234&fn=john&ln=doe&co=&ad1=18%20ches%20st%20#2%20city=chicago&st=il&zip=12345 I build the above link dynamically from the customer's input. It works fine...
1
by: DC Gringo | last post by:
I am having trouble building a URL the serves up an image dynamically...something involving the & separating my URL parameters. If I put the same URL in with & instead of the code-generated &,...
1
by: yawnmoth | last post by:
Any ideas as to why urlencode(addslashes(chr(0))) returns '%5C0'? It seems like it should return '%00' since that's what urlencode(chr(0)) returns. If not that, I could also see it returning...
1
by: Jim | last post by:
Hello, I'm trying to do urllib.urlencode() with unicode correctly, and I wonder if some kind person could set me straight? My understanding is that I am supposed to be able to urlencode...
4
by: Andreas Klemt | last post by:
Hello, is there a difference between System.Web.HttpUtility.UrlEncode and Server.UrlEncode ?
1
by: Dario Sala | last post by:
Hi, what's the difference about Asp Server.UrlEncode and the Asp.Net Server.UrlEncode ? In asp: Server.UrlEncode("*") = %2A In Asp.Net: Server.UrlEncode("*") = *
3
by: John A Grandy | last post by:
I am using a StringBuilder to build a link tag (based on categoryId and categoryName , which are populated elsewhere ) : StringBuilder sb = new StringBuilder(); sb.Append("<a...
4
by: Arnaud Delobelle | last post by:
Hi fellow python enthusiasts. Having recently acquired a MacBook Pro (Intel Core 2 Duo) which comes with python2.5, I have been installing some modules that I need (PIL, psycopg2, PyXML ...). ...
4
by: .Net Sports | last post by:
I need to dynamically assign a datalist attribute upon a helper function receiving data from a querystring. If a user picks a certain region, i need the datalist to display its back color, or any...
6
by: =?Utf-8?B?Q2hyaXMgRA==?= | last post by:
Hi - can someone PLEASE tell me what's wrong with the script below. In debug I verified that 'registrant' has a value. I can't figure our how to build the URL & this script generates the error...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.