473,395 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Cancel validation?

Hi everyone,

I have a VB.NET web form with some field validators and Save and Cancel
buttons. What I want to do is on the Cancel button On_Click event,
Response.Redirect to another page. The problem is that the client-side
validation occurs before even reaching the event for the Cancel button.
I've tried some ways to disable only the client-side validation, but I find
it a poor design that you can't have a command button bypass the jscript
validation routines.

Anyone found a workaround for this? Surely this problem occured before.

Thanks in advance for any help.

Eric
Nov 17 '05 #1
3 3684
You'll love this!

In the cancel button's properties list find "CausesValidation" and set it to
false.

:)

Justin
"news.public.microsoft.com" <mi*******@hotmail.com> wrote in message
news:Oh**************@TK2MSFTNGP11.phx.gbl...
Hi everyone,

I have a VB.NET web form with some field validators and Save and Cancel
buttons. What I want to do is on the Cancel button On_Click event,
Response.Redirect to another page. The problem is that the client-side
validation occurs before even reaching the event for the Cancel button.
I've tried some ways to disable only the client-side validation, but I find it a poor design that you can't have a command button bypass the jscript
validation routines.

Anyone found a workaround for this? Surely this problem occured before.

Thanks in advance for any help.

Eric

Nov 17 '05 #2
Hi

What about redirecting on the client

cancelbtn.CausesValidation = false;
cancelbtn.Attributes.Add("onclick","location.href= 'theRedirectPage.aspx';
return false");

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
"news.public.microsoft.com" <mi*******@hotmail.com> wrote in message
news:Oh**************@TK2MSFTNGP11.phx.gbl...
Hi everyone,

I have a VB.NET web form with some field validators and Save and Cancel
buttons. What I want to do is on the Cancel button On_Click event,
Response.Redirect to another page. The problem is that the client-side
validation occurs before even reaching the event for the Cancel button.
I've tried some ways to disable only the client-side validation, but I find it a poor design that you can't have a command button bypass the jscript
validation routines.

Anyone found a workaround for this? Surely this problem occured before.

Thanks in advance for any help.

Eric

Nov 17 '05 #3
Doh, it was almost jumping at me. I thought that this property controlled
if the control generated validation on the server. Wasn't sure about the
client-side.

Thanks a lot!

"S. Justin Gengo" <ge****@krause.com> wrote in message
news:vh************@corp.supernews.com...
You'll love this!

In the cancel button's properties list find "CausesValidation" and set it to false.

:)

Justin
"news.public.microsoft.com" <mi*******@hotmail.com> wrote in message
news:Oh**************@TK2MSFTNGP11.phx.gbl...
Hi everyone,

I have a VB.NET web form with some field validators and Save and Cancel
buttons. What I want to do is on the Cancel button On_Click event,
Response.Redirect to another page. The problem is that the client-side
validation occurs before even reaching the event for the Cancel button.
I've tried some ways to disable only the client-side validation, but I

find
it a poor design that you can't have a command button bypass the jscript
validation routines.

Anyone found a workaround for this? Surely this problem occured before.

Thanks in advance for any help.

Eric


Nov 17 '05 #4

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

Similar topics

6
by: Arno R | last post by:
Hi all I come across a 'feature' of Access (2000) that I don't like and would like to disable. I am checking if a value already exists in a table. I a subform I use code like : Private Sub...
0
by: PeacError | last post by:
Using Microsoft Visual Studio .NET 2003, Visual C# .NET 1.1: I apologize if this question has been addressed elsewhere, but I could not find a reference to it in the search engine for this...
1
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...
3
by: MB | last post by:
Hi, I am doing a project which uses asp.net to develop its forms. The form uses validation web controls to validate the data entered in text boxes. When Cancel Button is pressed which is to exit...
6
by: Peter M. | last post by:
Hi all, If an event has multiple subscribers, is it possible to cancel the invocation of event handlers from an event handler? Or to be more specific: I'm subscribing to the ColumnChanging...
1
by: David Veeneman | last post by:
I am writing a control that relies on its host to validate the contents of one of its fields. The control fires a custom 'FooNeedsValidating' event and passes the field's data with the event. The...
21
by: Darin | last post by:
I have a form w/ a textbox and Cancel button on it. I have a routine to handle textbox.validating, and I have the form setup so the Cancel button is the Cancel button. WHen the user clicks on...
1
by: Frank O'Hara | last post by:
I think I'm losing my mind, granted it is kind of late here so... I'm trying to do some simple validation on the client as keys are pressed. The validation routine works well enough however I...
5
by: Steve | last post by:
In VB6 I have a screen the has a text box and a datagrid If I click the datagrid, the 1st event is to validate the textbox and then the 2nd event is a datagrid mousedown event. If a get an error...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...

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.