开发者

ASP.NET server side form validation + jQuery validation

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜