disabling gridview
-
Does any1 know if its possible to disable gridview so no1 can click on it and copy the text, i.e. its totally disabled cheers
Hi, Just set the gridview's Enabled property to "False", i.e.
GridView.Enabled=False
Regards, Ujjaval Modi :) Manpower moves wrenches, horsepower moves cars, and the power of the mind moves the world.
-
Hi, Just set the gridview's Enabled property to "False", i.e.
GridView.Enabled=False
Regards, Ujjaval Modi :) Manpower moves wrenches, horsepower moves cars, and the power of the mind moves the world.
-
this doesnt stop someone right clicking on the text and copying it, this is what i need for them not to be able to right click and copy the text any ideas?
<asp:gridview visible="false">
Im afraid thats about your only choice. Im afraid that putting something on the internet makes it highlightable, right-click-able, view-sourceable or printable. There is no sure fire way of stopping any of these methods of copying the page short of making it invisible or not putting it on the internet to start with.modified on Friday, December 21, 2007 5:53:36 AM
-
<asp:gridview visible="false">
Im afraid thats about your only choice. Im afraid that putting something on the internet makes it highlightable, right-click-able, view-sourceable or printable. There is no sure fire way of stopping any of these methods of copying the page short of making it invisible or not putting it on the internet to start with.modified on Friday, December 21, 2007 5:53:36 AM
-
ah i thought i had seen it somewhere before where you couldn't copy text never mind thanks anyway
You can do it with some javascript, BUT that will work only against totally non-tech users. Anyone who know how to disable javascript or view page source in browser will be able to steal whatever you send to client.
[My Blog]
"Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - RĂ¼diger Klaehn
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe -
You can do it with some javascript, BUT that will work only against totally non-tech users. Anyone who know how to disable javascript or view page source in browser will be able to steal whatever you send to client.
[My Blog]
"Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - RĂ¼diger Klaehn
"Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe -
ive actually find some javascript now is there an equilivant of onkeydown for asp.net gridview? cheers
-
ive managed to find some javascript which stops then right clicking on it but I need something that also stops them from ctrl c as well any1 know? thanks
-
Can you please tell how to stop the users to copy the text using right click on it? Thanks in Advance SMARTech :)
there you go: document.oncontextmenu = function() { return false; } if ( document.layers ) { window.captureEvents(Event.MOUSEDOWN); window.onmousedown = function(e) { if ( e.target == document ) return false; } } else { document.onmousedown = function() { return false; } } // -->
-
Can you please tell how to stop the users to copy the text using right click on it? Thanks in Advance SMARTech :)
there you go: document.oncontextmenu = function() { return false; } if ( document.layers ) { window.captureEvents(Event.MOUSEDOWN); window.onmousedown = function(e) { if ( e.target == document ) return false; } } else { document.onmousedown = function() { return false; } } // -->
-
there you go: document.oncontextmenu = function() { return false; } if ( document.layers ) { window.captureEvents(Event.MOUSEDOWN); window.onmousedown = function(e) { if ( e.target == document ) return false; } } else { document.onmousedown = function() { return false; } } // -->
-
how about ctrl+a to select all then ctrl+c to copy or, view source and copy it all from there. You will never ever stop someone dedicated to copying the text froma web browser, the best you will achieve is hindering the non-techy.
there must be a way of stopping some using ctrl c and a how bout the below code i jus need to integrate it into asp.net do you know how i could put on key down for asp.net? function noCopyKey(e) { var forbiddenKeys = new Array('c','x','v'); var keyCode = (e.keyCode) ? e.keyCode : e.which; var isCtrl; if(window.event) isCtrl = e.ctrlKey else isCtrl = (window.Event) ? ((e.modifiers & Event.CTRL_MASK) == Event.CTRL_MASK) : false; if(isCtrl) { for(i = 0; i < forbiddenKeys.length; i++) { if(forbiddenKeys[i] == String.fromCharCode(keyCode).toLowerCase()) { alert('You are prompted to type this twice for a reason!'); return false; } } } return true; }