.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

disable COPY/Paste function on a textbox

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :ASP.Net
Hi, I want to make disable COPY/Paste function on a textbox. DO u know how to do it if so please let me know asap? And it is required to be done at client side. The text box can be HTML or ASP:TextBox. Please reply asap.

View Complete Post

More Related Resource Links

Disable copy paste in textbox without Javascript




Can you somebody help me in disabling copy paste in the textbox without using Javascript for an web application?




Disable "Paste" lable on read only textbox.

Hi, I am new to C# .NET. I am facing very small problem. i.e. I made a text box with readonly option. Now this text box is not allowing to paste,ok its working fine. But when i give mouse right click paste lable is enable. Can you guide me how to disable this lable. With Regards Srinubabu

How to disable textbox causing validation?

Hello I was running into a strange problem: If I left a textbox blank (in some instances) the textbox would not give up the focus (I could not even close the form).  I learnt later that this was because the text in the textbox was causing validation to fail.  I would have to type in some value (Satisfy validation) before i could close the form. This is problematic for me and I don't want the textbox to behave this way (I do not awnt front end validation).  I desire to have validation done ONLY on the back end.     I thought that I could solve this problem by changing the 'CausesValidation' property in the textbox to false.  This worked!  However it introduced a new problem.  The binding no longer worked on the Textbox.  That is, whatever value I typed in the textbox would not make it to the data set. What is the correct way in solving this problem???  I want validation to be shut off however I still (obviously) need to keep binding in tact...      

Button to copy selected item in dropdown to textbox

Hi, I found this bit of code which I tried and it isn't working. I just want to place a button next to a dropdown, and when clicked, the selected item in the dropdown will put into another textbox. <head><title>Untitled</title></head><body><script type="text/javascript">function copy() {var sel = document.getElementById("names");var text = sel.options.value;var out = document.getElementById("output");out.value += text+"\n";}</script> <select id="names"><option>Product One</option><option>Product Two</option><option>Product Three</option><option>Product Four</option></select><input type="button" onclick="copy()" value="Copy"><textarea id="output"></textarea> </body></html>   I saved this as a file and opened it in IE to test and nothing went into the textarea. Also i tried it in Firefox and the textarea said undefined each time I click the button. Can someone help to get this working?

Copy/paste broken in SSMS 2008 R2

After uninstalling an SSMS addin (from Red Gate), my copy/paste functionality in SSMS broke -- don't know if it's correlated.  As documented in the bug https://connect.microsoft.com/SQLServer/feedback/details/126743/copy-paste-stop-working-in-sql-2005 it seems that paste is working fine, because it works when I copy from other programs.  When I paste from SSMS, though, I can't paste anywhere.  It's as though SSMS clears the clipboard and that's all she wrote. Anyone else seeing this problem? -matthew

Copy/Paste Fails in Management Studio

After opening Management Studio and doing some editing it is possible to copy/paste things in the query editor. After a while (working in another app) I come back to Management Studio and I can't copy/paste anything anymore. If I try to copy from the results window I get an error message that the clipboard operation did not succeed. If I try to copy from the query editor window it just doesn't copy. I can copy/paste in other apps without a problem.   I have seen this problem described in other forums so I'm not alone but I have 3 other computers where this problem does not occur. The one machine with the problem is hyper-threading. I wonder .... Any other ideas? It is not the clipboard getting full but I can't rule out much else.

Image copy/Paste on a asp.net webpage

  Hi All,            I need a help, in my project I have a requirement, which is I have to copy image from MS-Word and paste it on webpage directly. So that copied image should be display on webpage and save into server automatically. It can be possible using windows applications., but now the same functionality has to implement in asp.net web applications. Any help much appreciated. J Hint:  using javascript Clipboard functionality we may achieve it, but could get correct solution for this . :( Thanks, Naidu 

Remove Word Style once copy and paste content to Rich text Editor in sharepoint 2010

Hi Guys, I have page layout for Users to add content for Page.I have site column for page content on field type HTML with Richtextmode="FUll Html". Now when user cut and paste content from Word document in this Field it carry word document style. how can i control this content on Page layout with CSS. Please adviseThanks Ron

Hidden question marks appear in copy/paste

Hi, I'm running into a really weird issue: when a user copies text from another file and pastes into an ASP textbox, question marks occasionally appear. For example, copying text from one file ("P/U FILE5") pastes correctly into the ASP textbox, displaying as "P/U FILE5" However, in the database, the text is stored as "P?/?U FILE?5"So by way of checking and converting the textbox string to a byte array, I see byte values like this: "80 63 47 63 85 70 73 76 69 83 63 53" which means that when I actually look at the VALUE of the textbox string, it's actually sticking question marks in there. But they don't appear anywhere in the textbox! Any idea of how to fix this?

Copy paste of url in new browser window should take me to Login Page

Hi,            I got one situation that if i paste the url in my current browser window to new browser window iam able to view the related page in new window instead i should redirect to my Login Page, can anyone help please its very much needed for me With Regards, Damodharam B V  

How to copy one textbox value to another?



I am using CreateUserWizard control. I would like to automaically copy email address from txtEmail1 text box from "CreateUserWizardStep1" to txtEmail2 text box in "CreateUserWizardStep2".

I am using C# as a code behind in my aspx page.

Thank you.


Read only error trying to copy and paste rows of records from Excel spreadsheet


I'm using Sharepoint 2010 and trying to open a list in Edit in Datasheet View. The list opens but when I try to paste lines into the sheet I get a Read-only error and it doesn't accept my paste. I removed all required fields.

I'm using XP and IE8

This function was working in SharePOint 2007.


VS2010 What happened to ctrl-V !! Ever since moving to VS2010 Copy / Paste functions are not workin


It is hit and miss and mostly miss when I atempt to cut and paste code from one place to another. Please help! I will use CTRL-V after cutting some code to paste it and it does nothing but move the currsor to the beginning of the line. I thought perhaps I had accedently changed the shortcut setting, but a revue of tools\options\keyboard\shortcuts verifed that CTRL-V should be pasting. I am sure you can imagine how debilitating this can be. I hope someone knows what is going on as I can find no information anywhere about it.


When editing a SSIS package in Visual Studio, copy-paste actions have annoying behaviours.


Currently, I'm in a project with high use of SSIS packages.

I've setup a package with many Sequence Containers in order to group Tasks and have these groups to execute modularly before continuing in the next group.

There are Tasks that are very similar, so I just copy-paste them and then change properties.

The problem is that, when I do the "paste", the Task rectangle is always placed in a left-bottom location relative to the currently existing Tasks and Sequence Containers (instead of below the coordinates of the mouse after the right click, as one would expect).

It was already annoying when I didn't use Sequence Containers, because I had to scroll around just to pick the Task in the strange place to where it was copied and put it in the right place.

But it started to be worse with Sequence Containers. Although it really detects the coordinates of the mouse and puts the Task inside a Sequence Container if I right-click over an empty space of the container, it continues to place the Task in a very far left-bottom place relative to the remaining objects. It causes the Sequence Container to stretch until its border contorns the Task in that strange place. I have to 1) move the Task object to the right place and 2) resize the Sequence Container borders to its original status.

Currently, to avoid the step 2 abov

Copy text into textbox and preserve font, style, etc.


Hi, I have a textbox on my page for users to enter input.  If they were to type text outside of the box, and then copy it into the textbox, how can I make the textbox able to preserve the style of the text copied into it: italics, bold-faced, etc.?

It currently will convert anything copied into it as plain text.

Thanks for your help. 

VS2010 - copy/paste XAML UTF-16 loses characters


I have some (generated) XAML which uses UTF-16 characters (in some of the text); however when I copy/paste the XAML from one VS2010 instance to another the UTF characters get mapped to UTF8 characters; e.g., left and right double quote chars turn into quote chars. This of course is disasterous when the characters occur within an attribute value!

How can I preserve UTF-16 text when pasting into a VS2010 window? (The original file is *loaded* into the VS2010 project and works fine there. I'm trying to isolate a problem by selectively excising parts of the XAML and to do this I use copy/paste into another VS2010 instance containing some XAML boilerplate to try out small segments from the original.)


Bill Cohagan

How to disable resize grip on multiline textbox?


I cannot seem to find what should be a simple setting to keep my multiline textbox to the height/width or row/column settings without the resize grip or ability to resize. How do I prevent resizing?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend