如何提示用户确认导航 [英] How to Prompt users Confirm Navigation
本文介绍了如何提示用户确认导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
与codeproject类似,当用户在文本框中键入内容并尝试导航或刷新页面时,将提示用户
确认导航
和选项:
留在这个页面上。离开这个页面。
如何创建这个?
解决方案
有一个在任何文本时触发的公共事件box值已更改。
在此活动中设置脏标志。
然后,每当您离开页面时,检查是否flag为true。
如果为true,则正确显示消息。
检查出来: Form + Is + Dirty + Confirm + To + Save + Or + Cancel [ ^ ]
Like in codeproject, when user types in the textbox, and tries to navigate or refresh away from the page, the user will be prompted
Confirm Navigation
and the options:
Stay on this page. Leave this page.
How to create this?
解决方案
Have a common event that is triggered when any of the text box values are changed.
Set a dirty flag in this event.
Then, whenever you navigate away from the page, check if this flag is true.
If it is true, display the message appropriately.
Check this out: Form+Is+Dirty+Confirm+To+Save+Or+Cancel[^]
这篇关于如何提示用户确认导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文