building a URL dynamically and URLEncode?

D

DC Gringo

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...0,admin02&f=1.1.1&g=EPSG:4326&h=5

_____
DC G
 
G

Guest

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
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top