在.ascx页面中,我有如下图像按钮:
"<asp:Image ID="imgPhotos" runat="server" Width="102" Height="82"/>"在它背后的代码中,我有:
this.imgPhotos.ImageUrl = "~/lib/services/GetSpaceImage.ashx";在GetSpaceImage.ashx中,我是动态生成图像的。但问题是,它第一次工作得很好。但是,第二次,以此类推,它永远不会生成新的图像。调试器仅在第一次(当应用程序加载时)使用hanlder。我尝试过使用:"context.Response.Cache.SetCacheability(HttpCacheability.NoCache);“
在ProcessRequest的开头。但这也无济于事。我错过了什么吗?敬请指教
发布于 2012-04-17 20:25:05
浏览器缓存了此请求,为每个ashx url添加唯一的参数,如下所示:
this.imgPhotos.ImageUrl = "~/lib/services/GetSpaceImage.ashx?param=" + DateTime.Now.Ticks.ToString();https://stackoverflow.com/questions/10190971
复制相似问题