views:

600

answers:

4

(ASP with c#)

-Can you disable an ASP validation on an event click before it postbacks and performs the validation?

I would like to load some details into a bunch of text-boxes with field validators on them, However I need to Disable the validation of these text-boxes in order to actually fill them as the validation seems to occur at post-back before code execution.

Thanks in Advance

A: 

If your wondering why I have field validators on if, Im loading in the data, its because the fields and hold user entered data too

A: 

Turn off validation and call it manually when you are ready.

nportelli
A: 

What you want is to set the "EnableClientScript" set to false, then when your initial load is finished, switch that back on. It will load the client side validation scripts.

You could do the same thing with the "Enabled" switch as well.

So basically, if you want a button to load your forms and then turn on validation, you could just create a method that enables/disables all of your validation controls, and call that to enable them after you have successfully populated your forms.

Cheers!

thismat
+2  A: 

ANSWER

Buttons have a bool 'Cuase Validation' setting