Cancel Submit ASP.NET

G

Guest

How do I cancel submit process if certain fields are not filled in my
ASP.NET form? I need to know how to do it using the Click sub for the
submit button (in the .vb file) and not using javascript, if possible.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

No_Spam said:
How do I cancel submit process if certain fields are not filled in my
ASP.NET form? I need to know how to do it using the Click sub for the
submit button (in the .vb file) and not using javascript, if possible.

When the server event of the button is running, the request has already
reached the server, so it's way too late to stop it.
 
M

Mark Rae

How do I cancel submit process if certain fields are not filled in my
ASP.NET form? I need to know how to do it using the Click sub for the
submit button (in the .vb file) and not using javascript, if possible.

I don't believe it's possible to do this without JavaScript...
 
T

Thomas Hansen

How do I cancel submit process if certain fields are not filled in my
ASP.NET form? I need to know how to do it using the Click sub for the
submit button (in the .vb file) and not using javascript, if possible.

Normally you'd use a RequiredFieldValidator, but since you explicitly
say that you've reached SERVER code you must use your own logic...
What about:
if( InputFieldsValid() )
{
/*...do something...*/
}

??

..t
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top