[英]ashx handler called only once from ascx page
在.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的开头。 但这也没有帮助。 我有什么想念的吗? 请指教
浏览器缓存了此请求,为每个ashx URL添加唯一的参数,如下所示:
this.imgPhotos.ImageUrl = "~/lib/services/GetSpaceImage.ashx?param=" + DateTime.Now.Ticks.ToString();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.