2
votes

ASP.NET 4.0 site

What could be a better practice for using 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.

2

2 Answers

1
votes

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

1
votes

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