Below Code is to get the error message from server side
foreach (BaseValidator v in Page.Validators)
{
if (!v.IsValid)
Response.Write(v.ErrorMessage);
}
private static readonly object lockObject = new object();
lock (lockObject){