joncodo
joncodo

Reputation: 2328

Image are not resizing

Here is the code for when I host the images. Originally, these images were huge. The images now are at 100x100 pixels. When I open the page, the images are the same size as before. Even though the properties of the files say each one is 100x100.

Are the images being saved somewhere and not overwritten? I overwrote the old images in the file path with the new ones.

.linkButtonsDiv { width: 25%;float: left;}
<div class="linkButtonsDiv">
    <asp:ImageButton ID="btnTwitter" ImageUrl="~/Images/twitterLogo.png" runat="server" onclick="btnTwitter_Click" />
</div>
<div class="linkButtonsDiv">
    <asp:ImageButton ID="btnWordPress" ImageUrl="~/Images/wordpressLogo.jpg" runat="server" onclick="btnWordPress_Click" />
</div>
<div class="linkButtonsDiv">
    <asp:ImageButton ID="btnTig" ImageUrl="~/Images/tigSourceLogo.png" runat="server" onclick="btnTig_Click" />
</div>
<div class="linkButtonsDiv">
    <asp:ImageButton ID="btnStack" ImageUrl="~/Images/stackExchangeLogo.jpg" runat="server" onclick="btnStack_Click" />
</div>

Upvotes: 0

Views: 89

Answers (2)

user1693593
user1693593

Reputation:

To force cache update and when (forced, depending on browser) reload doesn't work, you can simple do a trick with the link:

If your link is f.ex:

http://localhost:1234/Default.aspx

Do this to reload cache:

http://localhost:1234/Default.aspx?a

Change the letter for each time. If you are already using some arguments add it to the end:

http://localhost:1234/Default.aspx?some=arg&a

If you have a linked CSS, use it on that instead.

<link href="some.css?x" rel="stylesheet" type="text/css" />

The latter approach is always a good practice, not a single letter, but perhaps a version number:

<link href="some.css?v=101" rel="stylesheet" type="text/css" />

This way you can force cache update even if expire is set into far future.

Upvotes: 1

Oded
Oded

Reputation: 499002

The images are most likely still cached in the browser.

Do a hard refresh - Ctrl + F5 to force a download from the server.

Upvotes: 1

Related Questions