Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.Net image set ImageURL to external site
    primarykey
    data
    text
    <p>I am struggling to set ImageURL in a asp:image control. I am setting it to a URL from another site, at the moment I have several versions of the image trying to get one to work bellow is my code and the output.</p> <p>Function used in images bellow</p> <pre><code>Function BuildLogoPath() As String Return ConfigurationManager.AppSettings("WebPath") &amp; "/img/main/logo.jpg" End Function </code></pre> <p>ASP.net Code in page</p> <pre><code>&lt;asp:Image ID="imgFav" runat="server" ImageUrl='&lt;%: ConfigurationManager.AppSettings("WebPath") &amp; "img/favicon.ico" %&gt;' /&gt;&lt;br /&gt; &lt;asp:Image ID="Image2" runat="server" ImageUrl='&lt;%= ConfigurationManager.AppSettings("WebPath") &amp; "/img/main/logo.jpg" %&gt;' /&gt; &lt;asp:Image ID="Image3" runat="server" ImageUrl='&lt;% ConfigurationManager.AppSettings("WebPath") &amp; "/img/main/logo.jpg" %&gt;' /&gt; &lt;asp:Image ID="Image4" runat="server" ImageUrl='&lt;% Response.write(ConfigurationManager.AppSettings("WebPath") &amp; "/img/main/logo.jpg") %&gt;' /&gt; &lt;asp:Image ID="imgLogo" runat="server" ImageUrl='&lt;%# BuildLogoPath() %&gt;' /&gt;&lt;br /&gt; &lt;asp:Image ID="Image5" runat="server" ImageUrl='&lt;%= BuildLogoPath() %&gt;' /&gt; &lt;asp:Image ID="Image6" runat="server" ImageUrl='&lt;% BuildLogoPath() %&gt;' /&gt; &lt;asp:Image ID="Image7" runat="server" ImageUrl='&lt;% response.write(BuildLogoPath()) %&gt;' /&gt; &lt;%= ConfigurationManager.AppSettings("WebPath") &amp; "img/favicon.ico" %&gt;&lt;br /&gt; &lt;%= ConfigurationManager.AppSettings("WebPath") &amp; "/img/main/logo.jpg" %&gt; </code></pre> <p>Output:</p> <pre><code>&lt;img id="ContentPlaceHolder1_imgFav" src="&lt;%:%20ConfigurationManager.AppSettings(&amp;quot;WebPath&amp;quot;)%20&amp;amp;%20&amp;quot;img/favicon.ico&amp;quot;%20%&gt;"&gt;&lt;br&gt; &lt;img id="ContentPlaceHolder1_Image2" src="&lt;%=%20ConfigurationManager.AppSettings(&amp;quot;WebPath&amp;quot;)%20&amp;amp;%20&amp;quot;/img/main/logo.jpg&amp;quot;%20%&gt;"&gt; &lt;img id="ContentPlaceHolder1_Image3" src="&lt;%%20ConfigurationManager.AppSettings(&amp;quot;WebPath&amp;quot;)%20&amp;amp;%20&amp;quot;/img/main/logo.jpg&amp;quot;%20%&gt;"&gt; &lt;img id="ContentPlaceHolder1_Image4" src="&lt;%%20Response.write(ConfigurationManager.AppSettings(&amp;quot;WebPath&amp;quot;)%20&amp;amp;%20&amp;quot;/img/main/logo.jpg&amp;quot;)%20%&gt;"&gt; &lt;img id="ContentPlaceHolder1_imgLogo" src=""&gt;&lt;br&gt; &lt;img id="ContentPlaceHolder1_Image5" src="&lt;%=%20BuildLogoPath()%20%&gt;"&gt; &lt;img id="ContentPlaceHolder1_Image6" src="&lt;%%20BuildLogoPath()%20%&gt;"&gt; &lt;img id="ContentPlaceHolder1_Image7" src="&lt;%%20response.write(BuildLogoPath())%20%&gt;"&gt; http://office.logma.biz/onefit.com.jamie/img/favicon.ico&lt;br&gt; http://office.logma.biz/onefit.com.jamie//img/main/logo.jpg </code></pre> <p>As you can see the code is working fine when not not in the image control.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload