This question is locked. New answers and comments are not allowed.
hi,
Per your sample, I used Unobtrusive JQuery at client side to validate error. I found out it never hit server side in your sample when validation fails in client side. Howerver, in my application server side always hits even if client validation fails.
Per your sample, I used Unobtrusive JQuery at client side to validate error. I found out it never hit server side in your sample when validation fails in client side. Howerver, in my application server side always hits even if client validation fails.
config file:
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
register these script files to teleirk components.
.Add("~/Scripts/jquery-1.6.2.min.js")
.Add("~/Scripts/jquery.unobtrusive-ajax.min.js")
.Add("~/Scripts/jquery.validate.min.js")
.Add("~/Scripts/jquery.validate.unobtrusive.min.js")
Annonation MetaData:
[MetadataType(typeof(EPRMetaData))]
public partial class EPR { }
public class EPRMetaData
{
public Int32 Id;
[DisplayName("EPR_ID"), Required]
[StringLength(10,ErrorMessage="Field EPR_ID can't exceed 10 characters.")]
public String HP_EPR_ID { get; set; }
}
Thanks in advance.