'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" />
Solution 1:[1]
Webforms can be tricky with these sometimes.
Sounds like something to do with either the browser or the local scripts. Try the following:
- Different Browser
- Try a different image
- Change the Height & Width. See if anything helps
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Zee |
