图像处理程序页面

发布于 2024-09-11 02:43:50 字数 403 浏览 3 评论 0原文

我创建了一个图像处理程序页面,它检索本地计算机上图像的物理路径,然后使用文件流、调整大小并显示它 - 使用作为查询字符串传递的整数(记录 ID)。

发生的情况是,当页面加载中的例程找不到与记录 ID 相关的图像时,它会显示随机图像(来自其他记录)。

仅当相关记录 ID 没有图像时才会发生这种情况。如果记录不存在图像,则例程分配默认图像,但页面不显示默认图像,而是显示其他记录中的图像。如果我不断刷新页面,它会显示与其他记录不同的图像。

在我的页面加载事件中,在执行其他操作之前,我放置了:

Response.Cache.SetCacheability(HttpCacheability.NoCache)

但这并没有改变行为。

任何帮助表示赞赏。

谢谢,

KS

I created an image handler page which retrieves the physical path of an image on the local machine and then using filestream, resizes and displays it - using a integer (record id) passed as querystring.

What is happening is that, when the routine in pageload cannot find an image relating to the record id, it displays random images (from other records).

This only ocurrs when the related record id has no image. The routine assigns a default image if no image exists for the record, but instead of displaying the default image, the page is displaying images from other records. If I keep refreshing the page it displays different images from other records.

In my page load event, before doing anything else I have put:

Response.Cache.SetCacheability(HttpCacheability.NoCache)

But this has not changed the behaviour.

Any help appreciated.

thanks,

KS

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

池予 2024-09-18 02:43:50

您可以在代码中处理这种情况,因此当不存在图像时,您将显示静态空白图像。

You could handle the case in code so when no image is present, you display a static blank image instead.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文