0

I am facing a scenario where I have displayed some images in Asp.Net List view control. Everything works fine in visual studio debug mode, but the below problem occurs when I deploy the website.

Scenario- On the page load event, I call a method BindData() and this method fetches the data and binds the data in List view. I have a search button which also calls the BindData() and binds the same list view control.

Problem- When I deploy the website and open the page, the images are not loaded. But when I click search button, the images are visible.

Image tag inside List View <asp:ImageButton ID="lnkHistory" runat="server" CommandName="History" CommandArgument='<%#Eval("RecordID") %>' Height="20px" Width="20px" ImageUrl="~/Images/History.png" />

List View image on page load

List View image showing images after clicking search button

3
  • I would clear my browser cache. And try using ctrl-f5 to force a re-load of the scripts for the browser page. I suspect that the original page might be broken - and stray images are showing. it is assumed that those image links are in a folder that is part of the site? And you used VS to add + create the folder? (if you add the folder from windows explore, then VS might not see the web page, and thus when you publish, that folder of images is not being included. You might want to ftp into that web site, and check if your image folder was also published. Commented Mar 12, 2022 at 18:46
  • Cleared browser history + Cache. Ctrl+F5 done. Folder is already part of solution and is also present in deployment folder(including images). No luck till now. Commented Mar 16, 2022 at 7:37
  • gee, does older IE have a debug mode like new edge and chrome? You could try f12, and select elements - the picture element in the LV and see what gets spit out. Commented Mar 16, 2022 at 8:03

1 Answer 1

0

Webforms can be tricky with these sometimes.

Sounds like something to do with either the browser or the local scripts. Try the following:

  1. Different Browser
  2. Try a different image
  3. Change the Height & Width. See if anything helps
Sign up to request clarification or add additional context in comments.

1 Comment

Works on Edge, Chrome and all other browsers, except IE. Tried different image, no luck. Height & Width also didn't change anything.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.