By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,715 Members | 1,271 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,715 IT Pros & Developers. It's quick & easy.

need url parameter separator "&" not "&"

P: n/a
I have an image control (that pulls an image off an ESRI map server):
<ASP:IMAGE ID="imgZonedCountry" RUNAT="server"></ASP:IMAGE>

In the code behind I am setting the ImageURL to a String value with url
parameters like this:

imgZonedCountry.ImageUrl =
"http://server/servlet/com.esri.wms.Esrimap?param1=x&param2=y

When it serves up the page, I'm getting "&amp;" in place of the "&"
separator and my image is not coming up.

How can I deal with this?

--
_____
DC G
Nov 18 '05 #1
Share this Question
Share on Google+
3 Replies

P: n/a
Use Server.URLEncode to encode the URL properly and you will be fine.

"DC Gringo" wrote:
I have an image control (that pulls an image off an ESRI map server):
<ASP:IMAGE ID="imgZonedCountry" RUNAT="server"></ASP:IMAGE>

In the code behind I am setting the ImageURL to a String value with url
parameters like this:

imgZonedCountry.ImageUrl =
"http://server/servlet/com.esri.wms.Esrimap?param1=x¶m2=y

When it serves up the page, I'm getting "&" in place of the "&"
separator and my image is not coming up.

How can I deal with this?

--
_____
DC G

Nov 18 '05 #2

P: n/a
Sounds like and issue for
UrlDecode() and UrlEncode()

Curt

"DC Gringo" <dc******@visiontechnology.net> wrote in message
news:ur****************@TK2MSFTNGP12.phx.gbl...
I have an image control (that pulls an image off an ESRI map server):
<ASP:IMAGE ID="imgZonedCountry" RUNAT="server"></ASP:IMAGE>

In the code behind I am setting the ImageURL to a String value with url
parameters like this:

imgZonedCountry.ImageUrl =
"http://server/servlet/com.esri.wms.Esrimap?param1=x&param2=y

When it serves up the page, I'm getting "&amp;" in place of the "&"
separator and my image is not coming up.

How can I deal with this?

--
_____
DC G

Nov 18 '05 #3

P: n/a
DC Gringo wrote:
I have an image control (that pulls an image off an ESRI map server):
<ASP:IMAGE ID="imgZonedCountry" RUNAT="server"></ASP:IMAGE>

In the code behind I am setting the ImageURL to a String value with url
parameters like this:

imgZonedCountry.ImageUrl =
"http://server/servlet/com.esri.wms.Esrimap?param1=x&param2=y

When it serves up the page, I'm getting "&amp;" in place of the "&"
separator and my image is not coming up.

How can I deal with this?


The framework keeps an internal table of HTML attributes which contains
(among other things) a flag that indicates whether the attribute should
be HTML encoded by default. The "src" attribute is set to be encoded,
and the control rendering in the Image webcontrol seems to render
attributes with the default for the encoding setting - I don't think
there's a simple way to control this.

I think that you should be able to get this to work by

1) subclassing the Image control,
2) override the AddAttributesToRender() method,
3) in that method, render the "src" attribute yourself,
4) remove the src attribute form the control's attribute collection,
then
5) call the base.AddAttributesToRender() method so the rest of the
attributes will be written out.

Then, of course, you'd use your new Image-derived control instead.

Maybe there's a simpler way.
--
mikeb
Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.