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
245 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
[X]
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
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

752 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