处理ASP.net中的页面卸载事件 [英] Handle page unload events in ASP.net
本文介绍了处理ASP.net中的页面卸载事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
HI,
该应用程序包含一个aspx页面名称为test1.aspx.每次加载此页面时,我都会在布尔变量(变量名称:isSave)中获取真值或假值.假设如果我从该应用程序中的test1.aspx页导航到其他一些aspx页,则需要检查布尔变量.如果布尔变量为false,我什么也不想做.如果布尔变量为false,则需要显示确认警报框
谢谢
M.Dhanasekaran
The application contains a aspx page names as test1.aspx. Every time i am Loading this page i am getting the true or false values in the Boolean Variable ( variable name:isSave). suppose if i navigating from test1.aspx page to some other aspx pages in that application i need to check the boolean variable. if the boolean variable has false i dont want to do anything. if the boolean variable has false i need to show the confirm alertbox
Thanks
M.Dhanasekaran
推荐答案
您的意思是,当您尝试不输入消息而不单击按钮提交来浏览时,是否像codeproject一样?
向克里斯询问他如何在此站点上处理该问题,因为它确实满足了您的想法.
当然,仅关闭浏览器窗口就不会受到用户的保护,所以所有这些努力真的值得吗?
You mean like codeproject does when you try to browse away from entering a message without clicking the button to submit?
Ask Chris how he handled that on this site, because it does what I *think* you want to do.
Of course, there''s no protection from the user simply closing the browser window, so is all this effort really worth it?
如果布尔变量为false我不想要做任何事.如果布尔变量为false,则需要显示确认警报框
为什么需要为此处理卸载事件?
您有各种状态管理技术.使用任何一个.尝试Session
或QueryString
.
if the boolean variable has false i dont want to do anything. if the boolean variable has false i need to show the confirm alertbox
Why you need to handle unload event for this?
You have various state management techniques. Use any one. TrySession
orQueryString
.
这篇关于处理ASP.net中的页面卸载事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文