• We just launched and are currently in beta. Join us as we build and grow the community.

Disable Right Click and Ctrl Keys in ASP.Net

Pony

Multi-Channel Income Creator
P Rep
0
0
0
Rep
0
P Vouches
0
0
0
Vouches
0
Posts
147
Likes
117
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 300 XP
Submitted by
planetsourcecode

on
Sat, 06/13/2009 - 15:08

We can easily disable right click and control keys in asp.net.In come circumstances.We want to disable the right click so that the user can not copy from or to the asp.net web page.In most of the web application it can be use in any possible condition.
for doing this we have two possible ways:

1). Using asp.net method, which is used when we don't want to show message to the user

In this we are making "oncopy","onpaste","oncut" we used "return false"

2). Using JavaScript, which will provide a message to the user(alert message)

for doing this simply add java script into the head section of the web page where we want to restrict the user form the specified keys

Untitled Page

Note: you can place this function to MASTER PAGE, if we want this into many different pages

Now we have to call this function into our pages, using this coding

About the author:

PlanetSourceCode.in is a place for all developer providing free source codes, articles, complete projects,complete application in PHP, C/C++, Javascript, Visual Basic, Cobol, Pascal, ASP/VBScript, AJAX, SQL, Perl, Python, Ruby, Mobile Development

 

452,292

323,341

323,350

Top