user287745
user287745

Reputation: 3171

how to validate a textbox programmatically, that is at run time

i am creating textboxes when a button is clicked and again and again and so on

while accepting input i need to check if the boxes are all full,

i know how to do this using design view but how to do this using coding

that is add and validation control to the textbox when it created before initializing/adding it to the page.?

validation should be not null..

Upvotes: 0

Views: 1032

Answers (1)

runxc1 Bret Ferrier
runxc1 Bret Ferrier

Reputation: 8233

So as for validating the user input I would stay away from the ASP.Net Control Validators as hardly anyone in industry uses them. I would use the jQuery validator plugin which is included in a new Visual Studio project by default. You will still want Server side checking but it is much easier to call String.isNullOrEmpty(txtBox.Text) rather than using the Control Validators.

Upvotes: 1

Related Questions