473,397 Members | 2,056 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,397 software developers and data experts.

Dynamically enable a validator?

I am moving from Java to ASP .NET. Many .NET stuffs remain new to me.

I am wondering if it is possible to dynamically/programmatically enable
a validator.

Suppose that I have the following in my Web application:

Card Type:
o Master
o Visa
o Amex

Card Number:
___________________

If the user enters the card number, but forgets to select a card type,
I want to warn him that he must select a card type.

In other words, the RadioButtonList control validation of card type is
not required unless a valid card number is supplied.

Suppose the card number is validated with a RegularExpressionValidator
and the card type is validated with a RequiredFieldValidator.

Is it possible to do something like the Sub below?

Sub CardTypeValidator(sender As Object, args As
ServerValidateEventArgs)
If CardNumberValidator.IsValid() Then
//Enable CardTypeValidator here
End If
End Sub

I have not tried this. I want to know a little more before I give it a
shot. Thanks.

Nov 19 '05 #1
0 906

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

Similar topics

3
by: Alphonse Giambrone | last post by:
I am trying to enable/disable a requiredfieldvalidator on the client side and am generating an error. I had found some documentation on validation which states that I should be able to...
0
by: Trillium | last post by:
I am trying to upgrade a straight ASP project into .NET, but I am new at ..NET, and there seem to be so many different ways to do things. I am new to ..NET and need some guidance as to which...
2
by: VSK | last post by:
Hi all, I have a .ascx file with dropdownbox (SSN, EmpName) textbox submit button regular expression validator( controltovalidate is the above textbox) Now i want to change the Regular...
1
by: Tony | last post by:
Hi folks, I've got a bit of a problem. I have a situation where I build forms completely dynamically based on a form definition supplied from a database. Anyway, I noticed that required fields...
0
by: Jack | last post by:
Hi there, I'm trying to add validator controls dynamically and it's not working. The code is below.....thanks in advance for any answers. The control doesn't appear to be showing up in the...
3
by: LU | last post by:
I query database, QuestionID | QuestionName | QuestionType 1 | FirstName | TextBox 2 | LastName | TextBox Loop Create TextBox Create...
0
by: Phillie | last post by:
HI Gurus. I am trying to generate a Table with dynamic controls in different cells. I am at the same time generating Validation controls and assigning "control to validate" property to the ID of...
0
by: sonic | last post by:
I am trying to dynamically load a validator and must be missing something elementary here. I extended TextBox control to add some functionality to it. One new feature it contains is IsRequired...
0
by: anishanc | last post by:
Hai dear I have a sales form that contains a button to create new item, when the item's form is displayed i just disable the sales form. My question is that how can i enable the sales form...
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.