How do you make validators turn off with one button, not with another

C

COHENMARVIN

I'm working on a project which has a screen with edit fields, and two
buttons on the bottom. One button says SAVE and the other button says
DELETE. I want to use validators on the fields, but the validators
don't make sense when a DELETE button is clicked.
It doesn't seem to be a good idea to have a DELETE button on a screen
with edit fields, but I didn't design the screen and maybe my client
wants the users of the program to see the details of what they are
deleting.
So my question is, how do I disable the validation controls when the
user hits DELETE. If I set an 'enabled' property to False for all the
validation controls in the DELETE button routine, will that prevent
validation? Or could I make a seperate form just around the DELETE
button like this:
<FORM Name="MyForm2" runat="server" >
<INPUT TYPE="button" VALUE="Delete" id="DeleteButton"
OnServerClick="DeleteAdministrator" runat="server" />
</FORM>
So there would be two forms on the same ASP.net page. Would this work?
Or is there a better way.
Thanks in advance,
Marvin
 
R

Richard Dudley

There should be a property for the button called "CausesValidation". Set
this to False for the DELETE button and you should be OK.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top