<%@ Page Language="C#" AutoEventWireup="true" CodeFile="admin_Clu.aspx.cs" Inherits="admin_admin_Clu" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>企业文化</title>
<link href="../my.css" rel="Stylesheet" type="text/css" />
<script language="javascript">
<!--
function MaxLength(field,maxlimit)
{
var j = field.value.replace(/[^\x00-\xff]/g,"**").length;
//alert(j);
var tempString=field.value;
var tt="";
if(j > maxlimit)
{
for(var i=0;i<maxlimit;i++)
{
if(tt.replace(/[^\x00-\xff]/g,"**").length < maxlimit)
tt = tempString.substr(0,i+1);
else
break;
}
if(tt.replace(/[^\x00-\xff]/g,"**").length > maxlimit)
tt=tt.substr(0,tt.length-1);
field.value = tt;
}
else
{
;
}
}
-->
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table align="center" style="width: 682px; height: 303px;" border="0" cellpadding="0"
cellspacing="0">
<tr>
<td style="width: 615px">
</td>
</tr>
<tr>
<td align="center" style="width: 615px; height: 20px;">
<asp:Label ID="Label1" runat="server" Text="企业文化" Width="105px" Font-Names="宋体" Font-Size="12pt"></asp:Label></td>
</tr>
<tr>
<td style="width: 615px; height: 150px;" align="right">
<asp:TextBox ID="TextBox1" runat="server" Height="202px" TextMode="MultiLine" Width="98%"
Font-Names="宋体" Font-Size="12pt" onpropertychange="MaxLength(this,1300)"></asp:TextBox></td>
</tr>
<tr>
<td style="width: 615px" align="center">
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="企业文化不能为空"
ControlToValidate="TextBox1"></asp:RequiredFieldValidator></td>
</tr>
<tr>
<td style="width: 615px" align="center">
<asp:Button ID="Button2" runat="server" Text="提交" OnClick="Button2_Click" Width="127px" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
其中<tr>
<td style="width: 615px; height: 150px;" align="right">
<asp:TextBox ID="TextBox1" runat="server" Height="202px" TextMode="MultiLine" Width="98%"
Font-Names="宋体" Font-Size="12pt" onpropertychange="MaxLength(this,1300)"></asp:TextBox></td>
</tr>中的 onpropertychange="MaxLength(this,1300)1300代表字符个数