how to clear browser cache in asp.netjavascript? - Stack Overflow

In my program i need to handle with many images.I have to change images dynamically within the page. af

In my program i need to handle with many images.I have to change images dynamically within the page. after change the images i need to refresh the page by clear browser cache.

is there any method to clear cache or event for getting ctrl+f5 or ctrl+shift+del event in javascript or c# by a separate refresh button click. Here I cannot use browser refresh button.

In my program i need to handle with many images.I have to change images dynamically within the page. after change the images i need to refresh the page by clear browser cache.

is there any method to clear cache or event for getting ctrl+f5 or ctrl+shift+del event in javascript or c# by a separate refresh button click. Here I cannot use browser refresh button.

Share Improve this question edited Nov 17, 2011 at 15:00 Joel Coehoorn 417k114 gold badges578 silver badges815 bronze badges asked Aug 20, 2011 at 17:51 KIRAN K JKIRAN K J 7325 gold badges30 silver badges62 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

No. You can set expiration time to zero, but this can be overridden in browser preferences.

If you really need that the browser don't cache image, generate a random number and place it in the url

you cannot clear browser cache.the only idea is declare a session variable in c# code in page load and set its value is 1 at the very first time

if (!IsPostBack)
            {
Session["refresh"]="1"
}

you will need to set session variable in image upload button event Session["refresh"]="1" then create a refresh button .in the button event do the following thats all.after pleteing your upload,click on the refresh button.then it work as ctrl+f5 button.if you not set the session value 0 in refresh button event the last event is again takesplace.if you enter a value in database,the same task takesplace if you not set session variable 0.

   if(Session["refresh"].ToString()=="1")
   {
      Response.Write("<script type='text/javascript'>locaton.reload()</script>");
      Session["refresh"]="0";
    }

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745390785a4625652.html

相关推荐

  • how to clear browser cache in asp.netjavascript? - Stack Overflow

    In my program i need to handle with many images.I have to change images dynamically within the page. af

    10小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信