473,493 Members | 4,355 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Cancel Submit ASP.NET

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.

Feb 15 '07 #1
3 3632
No_Spam wrote:
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.

--
Göran Andersson
_____
http://www.guffa.com
Feb 15 '07 #2
"No_Spam" <no********@comcast.netwrote in message
news:11**********************@s48g2000cws.googlegr oups.com...
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...
Feb 15 '07 #3
On Feb 15, 2:45 am, "No_Spam" <no_to_s...@comcast.netwrote:
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

--
http://ajaxwidgets.com
Free ASP.NET Ajax Widgets NOW!

Feb 15 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2159
by: Jon | last post by:
Hi, I have a form. I have the code, below, to check for certain compulasry fields. The Submit button has: onClick="validate(this.form)" My problem is that the warnings come up fine, but the...
1
5463
by: Corey Olsen | last post by:
Can anyone point me to some documentation on bypassing validation controls when a user selects cancel? What I have is a user control with a form to fill out information on a subject. The user...
2
3578
by: Joe C. | last post by:
Is there a way to cancel the submit process from the client using vbscript?
3
2262
by: pmud | last post by:
Hi, I have an ASP.NET application using C# code. I am using a datagrid to display records from a database based on a user input, i.e a user enters a compnay name in text box & when he clicks a...
1
3917
by: Bucky | last post by:
I haven't found any vbscript code that can stop the form submission/postback after the msgbox. The problem is that asp:button is rendered as <input type="submit"> instead of <input type="button">....
10
5995
by: Andrew | last post by:
Hi, I have a messagebox that pops up due to an event. I did it in javascript. ie. alert("Time's up. Assessment Ended"); I want to capture the OK and Cancel events of this alert messagebox. My...
0
1680
by: Stuart Whiteford | last post by:
Hi, I've got a basic web form, two textboxes, a couple of radio button groups, some required field validators, and a Submit and Cancel button. When the page loads, if I click the Cancel...
4
15211
by: Martin | last post by:
I have a form with two submit buttons: <Save> and <Cancel>. When the user clicks on <Save>, I want to execute a validate function. When he clicks on <Cancel>, I want the form to submit without...
13
10528
Frinavale
by: Frinavale | last post by:
I've been trying all morning to cancel a form submit to the server. I have a JavaScript Object that determines whether or not the page should be submitted to the server depending on whether the...
1
2359
by: ghjk | last post by:
I'm using ajax in my php site. In there I have two buttons named as submit and cancel. When I click submit button it validates data using ajax. (No need to use form for this). But the following...
0
7118
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7192
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7364
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3087
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.