Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 12th, 2004, 02:30 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default Restricting Validator Controls

I have a web form with several validation controls on it. When the submit button is clicked, the validators fire as expected. However, I have another button on the form (to fill city and state info from a ZIP code) and when it is clicked, all the validators fire and don't allow the button's click event to fire.

Can I have validators fire only when a specific button is clicked?


Thanks in advance for your comments.

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.
 
Old November 12th, 2004, 04:30 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, I answered my own question. If you're interested, here's what I found out.

1. I should set the button's CausesValidation property to False

2. I should check to make sure the forecolor of a textbox doesn't match the backcolor.

#1 prevents validators from firing

#2 effectively hides the text and makes the programmer feel like a dumba$$ when he figures this out.

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting querystring change lily611 C# 2005 9 April 24th, 2008 03:05 AM
Validator controls throwing JavaScript errors Bob Bedell ASP.NET 2.0 Professional 7 December 31st, 2007 06:05 AM
Wire-up Validator controls cbigden BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 0 September 25th, 2007 10:28 AM
Restricting the # of digits after a decimal in a K stevenyoo321 VB How-To 1 April 18th, 2007 07:52 AM
DataGrid Controls Within custom validator control geetha_ganesan ADO.NET 1 March 26th, 2005 04:38 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.