When developing an Asp.net system, you often need to customize the browser menu and toolbar yourself.
In a recent project, I happened to have the opportunity to be responsible for this part.
The menu uses AspNetMenu, which seems not very stable, and the page refresh is also very serious. The toolbar uses IEWebControl provided by Microsoft. The toolbar works well, but sometimes events are lost (depressing, it seems to often happen in the .net framework). event is lost).
<script language="javascript">
function DisableKey()
{
//8 backspace key
//78 Ctrl+N
//37 Alt+ direction key ←
//39 Alt+ arrow keys→
//116 F5 refresh key
//82 Ctrl + R
//121 shift+F10
//115 Shield Alt+F4
//Shield shift and add the left mouse button to open a new web page
if (window.event.keyCode==8
||event.keyCode==78
||event.keyCode==37
||event.keyCode==39
||event.keyCode==116
||event.keyCode==82
||event.keyCode==121
||event.keyCode==115
||(window.event.srcElement.tagName == "A" && window.event.shiftKey))
{
alert('Please operate through transaction code!');
window.event.returnValue=false;
}
}
</script>
</HEAD>
< body MS_POSITIONING="GridLayout" onKeyDown="DisableKey()">
……………………
The above code has basically implemented the key values that need to be blocked.
It seems like the work has been done, but do I have to copy this code for every page? Still considering!
Please give some advice from experts. It should be said that it is a question of how to structure the system interface:)