public void HideAllFunction(Page page)
{
if(!page.IsStartupScriptRegistered ("msgHideAllFunction"))
{
string clientScript=@"<script language=JavaScript>
function KeyDown(){
if ((window.event.altKey)&& ((window.event.keyCode==37)||(window.event.keyCode==39))) //屏蔽 Alt+ 方向鍵 ← //屏蔽 Alt+ 方向鍵 →
{
event.returnValue=false;
}
if (event.keyCode==116) //屏蔽 F5 刷新鍵
{
event.keyCode=0;
event.returnValue=false;
}
if ((event.ctrlKey)&&(event.keyCode==78))//屏蔽 Ctrl+n
{
event.returnValue=false;
}
if ((event.shiftKey)&&(event.keyCode==121))//屏蔽 shift+F10
{
event.returnValue=false;
}
if (event.keyCode==122)//屏蔽 F11
{
event.keyCode=0;
event.returnValue=false;
}
}
function nocontextmenu()
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
document.onkeydown = KeyDown;
document.oncontextmenu=nocontextmenu;
</script>";
page.RegisterStartupScript("msgHideAllFunction",clientScript);
}
}