public override void RenderBeginTag(HtmlTextWriter writer) { // Set the maxlength and the min length using regex for multiline textboxes... RegularExpressionValidator rev = new RegularExpressionValidator { ControlToValidate = ClientID, ValidationExpression = @"^[\s\S]{" + MinLength + "," + (MaxLength == 0 ? 1000000 : MaxLength) + "}$", ErrorMessage = "Please enter a valid length." }; this.Parent.Controls.Add(rev); // The prev line is giving error: // Collection was modified; enumeration operation may not execute. // Even tried the above in Onprerender also, but no luck. base.RenderBeginTag(writer); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)