473,403 Members | 2,338 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,403 software developers and data experts.

need url parameter separator "&" not "&"

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
3 3555
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: BoonHead, The Lost Philosopher | last post by:
I think the .NET framework is great! It's nice, clean and logical; in contradiction to the old Microsoft. It only saddens me that the new Microsoft still doesn't under stand there own...
2
by: DC Gringo | last post by:
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...
2
by: Eric Osman | last post by:
Hi, I'm looking for a javascript function that will convert input such as this: <CLUB Code=" into this: &lt;CLUB Code=&quot;
4
by: barney | last post by:
Hello, I' m using .NET System.Xml.XmlDOcument. When I do the following: XmlDocument xml = new XmlDocument(); xml.Load("blah"); .... xml.Save("blub"); I've got the problem that the following...
5
by: martin | last post by:
Hi, I would be extremly grateful for some help on producing an xml fragemt. The fragment that I wish to produce should look like this <Addresses> <Address>&qout;Somebody's Name&quot;...
6
by: Rich | last post by:
Hello, I have to create a table in an Access mdb (remotely) on the fly. Create Table tbl1(fld1 Integer, fld2 varchar(10), fld3...) Then I have to insert data: Insert Into tbl1 Values(" &...
6
by: MilanB | last post by:
Hello What "0&" means in this function call? ret = InternetQueryOption(0&, INTERNET_OPTION_CONNECTED_STATE, _ ci, ci_len) Thanks Milan
14
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only...
10
by: lovecreatesbeauty | last post by:
Is parameter type conversion required for the 2nd argument on printf("%p", (void *)&i); ? But one would never call memcpy like: memcpy((void *)pi, (void *)pj, sizeof *pj); /*memcpy((void *)pi,...
1
by: Amith | last post by:
Here we are facing a problem which is when we pass a parameter to javascript putting '&' . Ex: &contact. In Japanese OS when we receive this parameter in the script '&' is converted to 'e'.So...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.