显示旧内容的对话框 [英] Dialog box displaying old contents

查看:111
本文介绍了显示旧内容的对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有两个按钮提交"和取消"的对话框.当我单击提交"按钮时,完成了一些过程,并显示选项已保存"作为消息并关闭对话框.当我再次打开对话框时,消息选项已保存"而不是提交和取消"按钮显示.我该如何解决?

i have got a dialog box with two buttons Submit and Cancel.When i click the submit button some process is done and shows "options saved" as message and closes the dialog.When i again open the dialog the message "options saved" is showing instead of Submit and Cancel button.How can i solve this?

推荐答案

我认为问题是由于缓存所致.
该对话框再次显示上一个缓存的页面.
您可以尝试清除浏览器的历史记录/缓存.
要在页面中实现,必须在对话框的页面加载事件中清除缓存.

尝试使用此代码(ASP .net C#)

I think the issue is due to the cache.
The dialoge displays the previous cached page again.
You can try by clearing the history/cache of the browser.
To implement in the page, you must clear the cache in the page load event of the dialoge box.

Try using this code (ASP .net C#)

HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);
HttpContext.Current.Response.Cache.SetExpires(DateTime.Now - new TimeSpan(1, 0, 0));
HttpContext.Current.Response.Cache.SetLastModified(DateTime.Now);
HttpContext.Current.Response.Cache.SetAllowResponseInBrowserHistory(false);


这篇关于显示旧内容的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆