M
mikeachamberlain
Hi.
I have an <asp:Image> control in which I am databinding the ImageURL
attribute. The URL is another ASPX page that provides the binary
source of the image,
The problem is that ASP.NET is insisting on HTML encoding the URL
string, so the ampersands in the querystring are converted to &s.
As a simple example of this, consider the following:
<asp:Image ID="Image1" runat="server" ImageUrl='<%#
"/Images/Download.aspx?username=mikeyc&imageID=2" %>' />
The outputted HTML is as follows:
<img id="Image1"
src="/Images/Download.aspx?username=mikeyc&imageID=2" ... />
Bah! How can I stop the ampersands from being encoded?
(BTW I realise that databinding is of no help here, but I am
simplifying the example.)
Mike
I have an <asp:Image> control in which I am databinding the ImageURL
attribute. The URL is another ASPX page that provides the binary
source of the image,
The problem is that ASP.NET is insisting on HTML encoding the URL
string, so the ampersands in the querystring are converted to &s.
As a simple example of this, consider the following:
<asp:Image ID="Image1" runat="server" ImageUrl='<%#
"/Images/Download.aspx?username=mikeyc&imageID=2" %>' />
The outputted HTML is as follows:
<img id="Image1"
src="/Images/Download.aspx?username=mikeyc&imageID=2" ... />
Bah! How can I stop the ampersands from being encoded?
(BTW I realise that databinding is of no help here, but I am
simplifying the example.)
Mike