RSG
RSG

Reputation: 1

Asp.Net web page does not load images on page load, but images load on button click

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

Upvotes: 0

Views: 567

Answers (1)

Zee
Zee

Reputation: 642

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

Upvotes: 0

Related Questions