Refresh image with a new one at the same url

后端 未结 19 3288
南旧
南旧 2020-11-21 22:00

I am accessing a link on my site that will provide a new image each time it is accessed.

The issue I am running into is that if I try to load the image in the backgr

19条回答
  •  借酒劲吻你
    2020-11-21 22:35

    I used the below concept of first binding the image with a false(buffer) url and next binding it with the valid url.

    imgcover.ImageUrl = ConfigurationManager.AppSettings["profileLargeImgPath"] + "Myapp_CoverPic_" + userid + "Buffer.jpg";
    
    imgcover.ImageUrl = ConfigurationManager.AppSettings["profileLargeImgPath"] + "Myapp_CoverPic_" + userid + ".jpg";
    

    This way, I am forcing the browser to refresh with valid url.

提交回复
热议问题