473,699 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need to have 'validation group'

On my page the user is ask to set of question.
Say there I have 2 controls like that
== pseudo-C#-code for my control ==
class MyControl : CompositeContro l
{
TextBox text;
LinkButton button

override void CreateChildCont rol()
{
text = new TextBox();
text.ID = "text"
Controls.Add(te xt);

button = new LinkButton();
buton.Text = submit;
button.Click = HCSubmit;
button.ID = "submit";

// == problem here
RequieredFieldV alidator rfv = new RequiredFieldVa lidator();
rfv.ControlToVe rify = "text";
Control.Add(rfv );
}
}
As you could see, text should have some value in it.
Now let's say I have 2 such control on the page and the user fill one and
press the submit link button, it won't be able to submit because the other
field would be empty.
Which is annoying.

Is there a way to limit the scope of the required field validator?
I coukld just remove it, but it provide nice features, so I'm wondering if
there is a solution to this problem, I have heard that ASP.NET 2.0 solve
it...
Feb 22 '06 #1
5 1902
In ASP.NET 2.0 there are validation groups which do exactly what you want.
For ASP.NET 1.x you are going to have to be more creative, using custom
validators rather than required field validators.

"Lloyd Dupont" <net.galador@ld > wrote in message
news:uT******** ******@TK2MSFTN GP14.phx.gbl...
On my page the user is ask to set of question.
Say there I have 2 controls like that
== pseudo-C#-code for my control ==
class MyControl : CompositeContro l
{
TextBox text;
LinkButton button

override void CreateChildCont rol()
{
text = new TextBox();
text.ID = "text"
Controls.Add(te xt);

button = new LinkButton();
buton.Text = submit;
button.Click = HCSubmit;
button.ID = "submit";

// == problem here
RequieredFieldV alidator rfv = new RequiredFieldVa lidator();
rfv.ControlToVe rify = "text";
Control.Add(rfv );
}
}
As you could see, text should have some value in it.
Now let's say I have 2 such control on the page and the user fill one and
press the submit link button, it won't be able to submit because the other
field would be empty.
Which is annoying.

Is there a way to limit the scope of the required field validator?
I coukld just remove it, but it provide nice features, so I'm wondering if
there is a solution to this problem, I have heard that ASP.NET 2.0 solve
it...

Feb 22 '06 #2
> In ASP.NET 2.0 there are validation groups which do exactly what you want.
Allright...
How does that work?
For ASP.NET 1.x you are going to have to be more creative, using custom
validators rather than required field validators.

"Lloyd Dupont" <net.galador@ld > wrote in message
news:uT******** ******@TK2MSFTN GP14.phx.gbl...
On my page the user is ask to set of question.
Say there I have 2 controls like that
== pseudo-C#-code for my control ==
class MyControl : CompositeContro l
{
TextBox text;
LinkButton button

override void CreateChildCont rol()
{
text = new TextBox();
text.ID = "text"
Controls.Add(te xt);

button = new LinkButton();
buton.Text = submit;
button.Click = HCSubmit;
button.ID = "submit";

// == problem here
RequieredFieldV alidator rfv = new RequiredFieldVa lidator();
rfv.ControlToVe rify = "text";
Control.Add(rfv );
}
}
As you could see, text should have some value in it.
Now let's say I have 2 such control on the page and the user fill one and
press the submit link button, it won't be able to submit because the
other field would be empty.
Which is annoying.

Is there a way to limit the scope of the required field validator?
I coukld just remove it, but it provide nice features, so I'm wondering
if there is a solution to this problem, I have heard that ASP.NET 2.0
solve it...


Feb 22 '06 #3
Hi Lloyd,

There are a couple of solutions for ASP.NET 1.1:

1. Use server side validation when the page is submitted to fire the
Validate() method of only the desired validators. This article -
http://aspalliance.com/699 - shows you how (along with many other validation
questions). See the topic "Several buttons associated with their own
validators".

2. I built a replacement to the ASP.NET validators that fixes the many
limitations I've found. Its called "Profession al Validation And More" (
http://www.peterblum.com/vam/home.aspx ). My validators have validation
groups. You simply assign a group name to the Group property on the submit
button and the associated validators. There are an enormous number of other
improvements I've made to validation and I include a utility to quickly
convert a page from your existing validators to mine.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Lloyd Dupont" <net.galador@ld > wrote in message
news:uT******** ******@TK2MSFTN GP14.phx.gbl...
On my page the user is ask to set of question.
Say there I have 2 controls like that
== pseudo-C#-code for my control ==
class MyControl : CompositeContro l
{
TextBox text;
LinkButton button

override void CreateChildCont rol()
{
text = new TextBox();
text.ID = "text"
Controls.Add(te xt);

button = new LinkButton();
buton.Text = submit;
button.Click = HCSubmit;
button.ID = "submit";

// == problem here
RequieredFieldV alidator rfv = new RequiredFieldVa lidator();
rfv.ControlToVe rify = "text";
Control.Add(rfv );
}
}
As you could see, text should have some value in it.
Now let's say I have 2 such control on the page and the user fill one and
press the submit link button, it won't be able to submit because the other
field would be empty.
Which is annoying.

Is there a way to limit the scope of the required field validator?
I coukld just remove it, but it provide nice features, so I'm wondering if
there is a solution to this problem, I have heard that ASP.NET 2.0 solve
it...

Feb 23 '06 #4
Hi Peter,

Thanks for your links.
Anyway I'm using 2.0 and it's an home project so.. I will certainly go with
build in validation group in 2.0
"Peter Blum" <PL****@Blum.in fo> wrote in message
news:Or******** ******@TK2MSFTN GP15.phx.gbl...
Hi Lloyd,

There are a couple of solutions for ASP.NET 1.1:

1. Use server side validation when the page is submitted to fire the
Validate() method of only the desired validators. This article -
http://aspalliance.com/699 - shows you how (along with many other
validation questions). See the topic "Several buttons associated with
their own validators".

2. I built a replacement to the ASP.NET validators that fixes the many
limitations I've found. Its called "Profession al Validation And More" (
http://www.peterblum.com/vam/home.aspx ). My validators have validation
groups. You simply assign a group name to the Group property on the submit
button and the associated validators. There are an enormous number of
other improvements I've made to validation and I include a utility to
quickly convert a page from your existing validators to mine.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Lloyd Dupont" <net.galador@ld > wrote in message
news:uT******** ******@TK2MSFTN GP14.phx.gbl...
On my page the user is ask to set of question.
Say there I have 2 controls like that
== pseudo-C#-code for my control ==
class MyControl : CompositeContro l
{
TextBox text;
LinkButton button

override void CreateChildCont rol()
{
text = new TextBox();
text.ID = "text"
Controls.Add(te xt);

button = new LinkButton();
buton.Text = submit;
button.Click = HCSubmit;
button.ID = "submit";

// == problem here
RequieredFieldV alidator rfv = new RequiredFieldVa lidator();
rfv.ControlToVe rify = "text";
Control.Add(rfv );
}
}
As you could see, text should have some value in it.
Now let's say I have 2 such control on the page and the user fill one and
press the submit link button, it won't be able to submit because the
other field would be empty.
Which is annoying.

Is there a way to limit the scope of the required field validator?
I coukld just remove it, but it provide nice features, so I'm wondering
if there is a solution to this problem, I have heard that ASP.NET 2.0
solve it...


Feb 23 '06 #5
As anyone was able to provide the (simple) answer let it be know it is very
simple.
BaseValidator and submiting control (LinkButton, Button, etc...) have a
string ValidationGroup { get; set;}
property.
Just fill it and... Voila!

--
Regards,
Lloyd Dupont

NovaMind development team
NovaMind Software
Mind Mapping Software
<www.nova-mind.com>
"Lloyd Dupont" <net.galador@ld > wrote in message
news:uT******** ******@TK2MSFTN GP14.phx.gbl...
On my page the user is ask to set of question.
Say there I have 2 controls like that
== pseudo-C#-code for my control ==
class MyControl : CompositeContro l
{
TextBox text;
LinkButton button

override void CreateChildCont rol()
{
text = new TextBox();
text.ID = "text"
Controls.Add(te xt);

button = new LinkButton();
buton.Text = submit;
button.Click = HCSubmit;
button.ID = "submit";

// == problem here
RequieredFieldV alidator rfv = new RequiredFieldVa lidator();
rfv.ControlToVe rify = "text";
Control.Add(rfv );
}
}
As you could see, text should have some value in it.
Now let's say I have 2 such control on the page and the user fill one and
press the submit link button, it won't be able to submit because the other
field would be empty.
Which is annoying.

Is there a way to limit the scope of the required field validator?
I coukld just remove it, but it provide nice features, so I'm wondering if
there is a solution to this problem, I have heard that ASP.NET 2.0 solve
it...

Feb 27 '06 #6

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

Similar topics

2
1519
by: Czarina | last post by:
hi guys! here I am again, bugging you Here is where my page stands right now: http://www.gainesvillewebs.com/czar...h_results-2.htm The top 2 forms are working just fine, but the bottom one, with the check boxes, it not working I am by NO MEANS, a Javascript expert, so please be patient! Here is what it needs to do: It need to check that at least 1 checkbox is selected, and if not, display error message.
4
1999
by: Adrienne | last post by:
I am the first to admit that I know bupkis about javascript, except that sometimes I need it to do something client side that I can't do server side. Anyway, here's my problem: <input type="text" name="ticket" id="ticket"> <input type="text" name="amount" id="amount"> My ASP script defaults ticket to be 30.00 and amount to be 600.00. What
3
1112
by: Miljana | last post by:
Are modern browsers, except IE, supported in ASP.NET 2.0? I read in some article that ASP.NET 2.0 will support client-side validation not only in IE but other modern non-Microsoft browsers (Mozilla, Netscape, Opera...) but I can't find confirmation anywhere. Can enybody give me more information or post a link? Thanks in advance
1
3018
by: sck10 | last post by:
Hello, I have a button that is associated with a validation group. When I click the button and a validation fails, I still want to code to execute. Can this be done? Any help with this would be appreciate. Thanks in advance, Sck10 In my code behind: Sub Submit_Click(ByVal Sender As Object, ByVal Args As EventArgs)
18
3030
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How ??
1
6949
by: Paul Aspinall | last post by:
Hi I want to put all my validation code in one place, for my FormView control, regardless of whether its editing or inserting data. Is there a 'Validation' event somewhere?? or do I point the ItemUpdating and ItemInserting events to the same place, and put my validation code there? Thanks
1
1319
by: Mukesh | last post by:
Currently i am developing a web application using asp.net1.1. I have developed several user control for this application . I am using validator in such user control. My problem is that whenever I use two controls ( both having required field validator )together on a single page. The required field validator validator creates problems . They interferes each others area. n shows me an err. Plz help me
1
1611
by: pawel667 | last post by:
I've got a homework to do for a next week, and cannot pass it. I had to create key which pass the validation for name "sample.domain.com". Any idea to simple reverse it ? Here is a code: ######################## Imports System
5
2623
by: da | last post by:
I've inherited an ASP.net 2.0 (VB.net) application that uses a lot of GridViews and DetailsViews. I've ran into an odd issue with validation. We've added some validators to the INSERT template to validate a field. They include a required field validator, a Regex validator checking the length of the field, and a custom validator. Each is then assigned to the same validation group. We then added a validationSummary referencing that same...
0
8686
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8615
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9173
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9033
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7748
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6533
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5872
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4375
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2009
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.