2

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 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.