Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > need url parameter separator "&" not "&"

Reply
Thread Tools

need url parameter separator "&" not "&"

 
 
DC Gringo
Guest
Posts: n/a
 
      08-19-2004
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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?QnJhZCBSb2JlcnRz?=
Guest
Posts: n/a
 
      08-19-2004
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
>
>
>

 
Reply With Quote
 
 
 
 
Curt_C [MVP]
Guest
Posts: n/a
 
      08-19-2004
Sounds like and issue for
UrlDecode() and UrlEncode()

Curt

"DC Gringo" <(E-Mail Removed)> wrote in message
news:ur5%(E-Mail Removed)...
>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
>
>



 
Reply With Quote
 
mikeb
Guest
Posts: n/a
 
      08-19-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
file reading by record separator (not line by line) Lee Sander Python 6 06-01-2007 05:57 AM
Does Ruby need a "line separator" class? Wes Gamble Ruby 9 07-31-2006 07:18 PM
Compare validator does not allow thousand separator for double datatype. Kaja ASP .Net 0 09-09-2004 05:28 AM
URL - substitution of a correct URL by a GUID like URL in favorites. Just D. ASP .Net Mobile 0 08-11-2004 04:26 PM
redirect URL's, return URL's, and URL Parameters Jon paugh ASP .Net 1 07-10-2004 05:29 AM



Advertisments