开发者

ASP.NET server side form validation + jQuery validation

开发者 https://www.devze.com 2023-02-26 03:09 出处:网络
ASP.NET 4.0 site What could be a better practice for using开发者_如何学C both ASP.NET server side form validation + jQuery client validation? I found that if usingcontrol with ASP.NET form validator

ASP.NET 4.0 site

What could be a better practice for using开发者_如何学C both ASP.NET server side form validation + jQuery client validation? I found that if using control with ASP.NET form validator controls, the TextBox tag will be populated as in HTML with a long ID. Will this long ID causing any trouble when using jQuery validation lib due to the ID is not easily predictable? Please advise.


If you're using .Net 4, you can use the new ClientIDMode for your controls. Also, you can use markup: '<%= Mytextbox.ClientID %>' in javascript.


You can use the (asp.net usercontrol) ClientId property on controls to ensure the id of the control on the clientside

0

精彩评论

暂无评论...
验证码 换一张
取 消