I am developing a application in Silverlight. I want to restrict, when user changes the url directly from address bar. How to stop this.
There is no way of stopping that. You are not in a position to control the user like that. You could use the beforeonload
event of the window
object in JavaScript to present a warning to the user.
<script>
window.onbeforeunload = function() {
return "You should not leave this page.";
};
</script>
来源:https://stackoverflow.com/questions/8062539/how-to-tack-browser-manual-change-in-silverlight