Re: asp.net datagrid image won't show after publish to internet

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Craig Deelsnyder (cdeelsny_at_no_spam_4_meyahoo.com)
Date: 08/08/04


Date: Sat, 07 Aug 2004 23:41:53 -0500

On 7 Aug 2004 18:20:32 -0700, Rob Rogers <rob@natltc.com> wrote:

> I have an ASP.NET datagrid that contains an image. The image can be
> one of two images, either "INFO.GIF" or "NOINFO.GIF". The datagrid
> looks fine when I test it from my local machine in visual studio.net,
> but when I publish it to the net, the "INFO.GIF" image doesn't show
> up.
> I am pulling my hair out on this one. Here is the code from my aspx
> file.
>
> <asp:templateColumn>
> <itemtemplate>
> <asp:HyperLink id="HyperLink1" runat="server" Target="_blank"
> NavigateUrl='<%# SetDisLink(DataBinder.Eval(Container, "DataItem.URL")
> ) %>'>
> <img src='<%# iif((DataBinder.Eval(Container,"DataItem.URL") >"
> "),"Info.gif","NoInfo.gif") %>' />
> </asp:HyperLink>
> </itemtemplate>
> </asp:templateColumn>
>
> The "SetDisLink" simply returns a url for the "Info" image to link to.
>
> Can someone please help me.

So in the HTML source in the browser, you verified it's putting the
correct image in there? I would say your image isn't physically there on
the server or the URL is wrong in the HTML...

-- 
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET