
<EditItemTemplate>
<asp:TextBox ID="txbDescription" Style="width: 390px; margin-left: 4px;" runat="server"
TextMode="MultiLine" Rows="3" Text='<%# Bind("Description") %>' MaxLength="1000" Wrap="true" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txbDescription"
ErrorMessage="A Document description is required" Enabled="true" runat="server">
</asp:RequiredFieldValidator>
<asp:CustomValidator ID="val_txbDescription" Enabled="true" runat="server"
ErrorMessage="Description is too large. Please limit text to 1000 characters."
OnServerValidate="val_txbDescription_ServerValidate" Display="Dynamic" ControlToValidate="txbDescription">
</asp:CustomValidator>
</EditItemTemplate>
protected
void val_txbDescription_ServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid =
true;
if (args.Value.Length > 1000) args.IsValid = false;
}


