Freelance Project Requests Software Development in C# WPF Asp.Net Core Vba Excel Word SQL-Server EF Linq, UWP Net



How to update an image in an Asp.Net website when the Browser Cache is turned on.

If I display a picture on a web page and change it with the upload, then the new picture is not displayed because the browser has cached the previous picture in the cache.

Can I update the browser cache?


Image output

<img src="@Html.Raw(ViewData["Profil_Image"] />




In asp mvc core, the image address is extended with a query parameter and a current time


<img src="@Html.Raw(ViewData["Profil_Image"] + "?" + DateTime.Now.Ticks)" />


In the website

<img src="/User_Files/User_Images/400/User_Image_1.jpg?636582684020015936" >




Asp View, Asp Razor MVC Core


    ViewData["Title"] = "📝 User Profil Image" ;




<!DOCTYPE html>




    <meta name="viewport" content="width=device-width" />




    <span style="margin-top:10px;"> Profil Image:</span>

    <br />

    <form asp-controller="Manage" asp-action="User_Profil_Image_Upload" method="post"



        <input type="file" name="uploaded_File" />

        <button type="submit" style="">Upload</button>



    <br />

    @if (ViewData["Profil_Image"] !="")


    <img src="@Html.Raw(ViewData["Profil_Image"] + "?" + DateTime.Now.Ticks)" alt="Uploaded Image" />

    <br />




    @if (ViewData["Error"] != null)


    <label>Error= @ViewData["Error"]</label>



    <br />





HTML: Move the position of an element only up to a certain position
Javascript: attach event to all children
Asp: Display image refreshed despite browser cache
Show Emoticons as Black and White Graphics
jQuery Example: Convert text to number, swap image
How can I copy something to the clipboard with a button from a web page?
Javascript: how to get the URL of the current website
Javascript: Query dialog OK Cancel
Bilder automatisch in der Größe anpassen mit CSS
Javascript: change style in javascript


Contact for Jobs, Project Requests: