我正在编写一个网站,该网站的页面必须显示图像。此图像是由 HttpHandler 使用查询字符串命令创建的,我怎样才能使它在没有任何闪烁的情况下工作?
提前致谢,如果您需要一些代码,我很乐意分享!
最佳答案
您可以使用 2 个 UpdatePanel 并在每次“重新加载”后切换它们:
Load Frame1 into Panel1 and hide Panel2 at Postback/Pageload
Load Frame2 into Panel2 per AJAX and after the Image is loaded show Panel2 and hide Panel1
Load Frame3 into Panel1 per AJAX and after the Image is loaded show Panel1 and hide Panel2
aso....
然后您甚至可以使用 JS 从 Panel1->Panel2 平滑淡入淡出(参见 HERE 或使用 jQuery fadeIn() 和 fadeOut() 更容易)。
关于c# - 更新图像而不闪烁 ASP.NET C#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6648517/