Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

I need to disable all RequiredFieldValidators on my web page but my code does not seem to be working.

Posted on 2004-10-12
5
243 Views
Last Modified: 2010-04-23
               ValQ1.Enabled = False
      ValQ2.Enabled = False
      ValQ3.Enabled = False
      ValQ4.Enabled = False
      ValQ5.Enabled = False
      ValQ6.Enabled = False
      ValQ7.Enabled = False
      ValQ8.Enabled = False
      ValQ9.Enabled = False
      ValQ10.Enabled = False

In some parts of my code this is working and in others it just isn't

Any ideas? I need to completely remove validation if a certain sutuation arises.

Cheers

Paul G
0
Comment
Question by:pgilfeather
  • 2
  • 2
5 Comments
 
LVL 19

Expert Comment

by:arif_eqbal
ID: 12285733
Does it still Validate or just displays the message???

try ValQ10.Visible=False for all validators
0
 

Author Comment

by:pgilfeather
ID: 12285755
Both, it validates and shows the message.

I have tried valQ10.visible =False

I have also tried

ValQ10.EnableClientScript=false

It is the first thing that is being called in the procedure.
0
 
LVL 19

Accepted Solution

by:
arif_eqbal earned 500 total points
ID: 12285848
strange I'll simulate it here and see

0
 
LVL 10

Expert Comment

by:123654789987
ID: 12285924
According to the link below u have to set the ClientTarget attribute in the Page directive to "downlevel" to disable client side script

http://www.codeproject.com/aspnet/groupvalidator.asp
0
 

Author Comment

by:pgilfeather
ID: 12286087
The client Target works but it simply disables all validation all of the time and this is not what I want. I want to be able to control the validation.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question