L
Lloyd Dupont
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 : CompositeControl
{
TextBox text;
LinkButton button
override void CreateChildControl()
{
text = new TextBox();
text.ID = "text"
Controls.Add(text);
button = new LinkButton();
buton.Text = submit;
button.Click = HCSubmit;
button.ID = "submit";
// == problem here
RequieredFieldValidator rfv = new RequiredFieldValidator();
rfv.ControlToVerify = "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...
Say there I have 2 controls like that
== pseudo-C#-code for my control ==
class MyControl : CompositeControl
{
TextBox text;
LinkButton button
override void CreateChildControl()
{
text = new TextBox();
text.ID = "text"
Controls.Add(text);
button = new LinkButton();
buton.Text = submit;
button.Click = HCSubmit;
button.ID = "submit";
// == problem here
RequieredFieldValidator rfv = new RequiredFieldValidator();
rfv.ControlToVerify = "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...