Thursday, 16 January 2014

JQuery:How to Disable Cut,Copy and Paste of TextBox in ASP.NET

Hi friends,in this article i will explain about JQuery:How to Disable Cut,Copy and Paste in ASP.NET.

Write the below code in the .aspx page
ASP.NET:                                              Previous Article>>Copy and Paste User Selected TextKey
<html xmlns="">
<head id="Head1" runat="server">
    <title>JQuery:How to Disable Cut,Copy and Paste in ASP.NET</title>
    <script type="text/javascript" src="">
    <script type="text/javascript" language="javascript">
        ///First Way
        $(document).ready(function () {
            $('#txtDisable').live("cut copy paste", function (e) {

        ///Second Way
        $(document).ready(function () {
            $('#txtSecond').bind("cut copy paste", function (e) {
    <form id="form1" runat="server">
    <h3>JQuery:How to Disable Cut,Copy and Paste in ASP.NET</h3>
    <span>Disable Cut,Copy and Paste using live() method</span><br />
    <asp:TextBox ID="txtDisable" runat="server"></asp:TextBox><br />
       <span>Disable Cut,Copy and Paste using bind() method</span><br />
    <asp:TextBox ID="txtSecond" runat="server"></asp:TextBox><br />
    <%--  Third Way--%>
    <span>Disable Cut,Copy and Paste using oncopy,oncut and onpaste by giving return false</span><br />
    <asp:TextBox ID="txtThird" runat="server" oncopy="return false;" oncut="return false;"
        onpaste="return false;"></asp:TextBox>

In above code i show how to disable Cut,Copy and Paste of textbox in 3 ways.
Live Demo:

                    Previous Article>>  Copy and Paste User Selected Text
"If you like my blog or articles, you can appreciate by leaving your comments or Liking my Facebook pageAspdotnet-kishore, following on Google+ Aspdotnet-Kishore, Twitter  on AspdotnetKishore, Linked in Aspdotnet-Kishore, stumbling my posts on stumble upon and subscribing on  RSSfeed Aspdotnet-Kishore for free updates directly to your Email inbox . Watch my blog  for more articles."

No comments:

Post a Comment

© 2012-2018 All Rights Reserved.
The content is copyrighted to Kishore and may not be reproduced on other websites without permission from the owner.