<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server"  TextMode="MultiLine"></asp:TextBox>
    </div>
    </form>
</body>
</html>protected void Page_Load(object sender, EventArgs e)
    {
        this.TextBox1.Attributes.Add("onkeypress", "javascript:if(this.value.length>=6) return false;");
        TextBox1.Attributes.Add("onKeyDown", "javascript:if(event.keyCode!=8){if(this.value.length>6) return false};");
        TextBox1.Attributes.Add("onblur", "javascript:if(this.value.length>6){this.value=this.value.substr(0,6);alert('超出6个字符的最大限制');this.focus();};");
    }
现在效果:
单个字符输入的时候,超过六个字符后 能很好的控制不让再输入
但是在不能控制复制的情况,复制时候我alert('超出6个字符的最大限制')
请问怎么使得在复制的时候自动的只留下前六个字符,就像单行文本框那样 谢谢