Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional 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
  #1 (permalink)  
Old February 19th, 2009, 02:13 PM
Authorized User
 
Join Date: Oct 2008
Location: Scottsdale, AZ, USA.
Posts: 23
Thanks: 5
Thanked 0 Times in 0 Posts
Default Validation rearing its ugly head.

I have a MasterPage with multiple controls or webparts depending on what's happening.
Anyway i have a searchbox control with 2 textboxes. I use the
RequiredFieldValidator and a ValidatorCalloutExtender for each textbox. I have also implemented the TextBoxWatermarkExtender and AutoCompleteExtender from the ajaxtoolkit. I load this search control on every page. When i am using the search control, it works like a champ. However, some pages seem to activate the validation routines when i am not even using the search control. So, in order to post page i have to put some data in the search box. Any ideas?
  #2 (permalink)  
Old February 19th, 2009, 02:23 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Yes, in fact two.

Put the search button into a validation group that nobody uses.
And if a button can be pressed with no validation needed you have a property to tell it to not generate validation (sorry, mind went blank I don't recall the name..)...
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
The Following User Says Thank You to gbianchi For This Useful Post:
scottlucas58 (February 19th, 2009)
  #3 (permalink)  
Old February 19th, 2009, 03:32 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

The property is CausesValidation. Set it to False and it will not cause the validators to fire. I prefer to have my validators inside of Validation Groups so as to avoid this problem but to each their own.

hth.
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
The Following User Says Thank You to dparsons For This Useful Post:
scottlucas58 (February 19th, 2009)


Similar Threads
Thread Thread Starter Forum Replies Last Post
For graphics gurus... your head in C++ programmed C++ Programming 1 November 2nd, 2006 08:21 AM
The ugly prompt when using RunSql Command Paula222 Access VBA 2 February 8th, 2006 10:20 AM
I am so in over my head AnnMarie Dreamweaver (all versions) 1 May 19th, 2005 02:19 PM
Can't get my head around - help. Mantis MySQL 2 February 23rd, 2005 12:19 PM
ugly result with Replace function PostmanPat C# 3 August 11th, 2004 04:36 PM





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