Thursday, May 3, 2012

How to add custom error message into ValidationSummary on server side in ASP.NET webform?

On server side event handler, add following code:
                CustomValidator val = new CustomValidator();
                val.IsValid = false;
                val.ErrorMessage = "Error ";
                this.Page.Validators.Add(val);

http://blog.webmastersam.net/post/Adding-custom-error-message-to-ValidationSummary-without-validators.aspx

No comments:

Post a Comment