zahed zahed - 3 months ago 8
ASP.NET (C#) Question

Gallery is not showing after uploading into live site using ASP.NET C#

Below I am calling my gallery using Datalist in localhost gallery is showing and live site not showing.

<asp:DataList ID="dlImages" runat="server">
<ItemTemplate>
<ul>
<li><a href="#cube">
<asp:Image ID="Image2" runat="server" class="cubeHide" ImageUrl='<%# Bind("ImageName", "/GalleryImages/{0}") %>' />
</a>
<div class="label_text">
</div>
</li>
</ul>
</ItemTemplate>
</asp:DataList>

Answer

1.Change ImageUrl from this:

ImageUrl='<%# Bind("ImageName", "/GalleryImages/{0}") %>'

To this:

ImageUrl='<%# Bind("ImageName", "~/GalleryImages/{0}") %>'

2.Make sure you have a folder called GalleryImages in the root of your website with the relevant image files.