Hi Clinton,
It's been a long time since I've used a DataList and I'm still using
VS.NET 2003, but I know that when working with DataGrid's, if you want
to gain access to the items that are on a row of the grid you work with
the "e.Item" argument of the specific event you are dealing with. If
you have set up these textboxes as templates and have given them ID's,
you could use "e.Item.FindControl(controlName)" to locate the control.
-Good luck!
message Hey that was nice of you but I'll work this aspect of the code out
myself as there's a bit more to it noting the following rules just for
starters:
* Both TextBoxes empty? (one must be populated)
* Both populated? (only one may be populated)
* Valid input in the TextBox? (one must be an email address the other
must be an alphanumeric name)
However, it would be helpful of you know how to identify which of the
LinkButtons generated by a DataList were used to display the set of
TextBoxes we have been talking about. The 2.0 Wizard control requires
the items generated by the DataList to inherit from IButtonControl
which supports a Text property I need to reference.
I'm googling...and deep into the doo at msdn2.microsoft.com working on
the answer and hey, I appreciate your comments...
--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL
http://clintongallagher.metromilwaukee.com/
MAP
http://wikimapia.org/#y=43038073&x=-88043838&z=17&l=0&m=h
Your scenario would be pretty simple:
<SCRIPT LANGUAGE="JavaScript">
function testFields(source, args)
{
if(txtField1.value == "" && txtField2.value == "")
{
args.IsValid = false;
}
else
{
args.IsValid = true;
}
}
</SCRIPT>
message Good tip thank you for the snappy reply. I haven't had to use a
Custom Validator yet and was thinking I might need another I haven't
had any experience with yet; the ValidatorGroup (but no).
--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL
http://clintongallagher.metromilwaukee.com/
It wouldn't be a RequiredFieldValidator, it would be a
CustomValidator and you'd write your own if/then logic.
message I have to get to this later tonight or tommorrow...and wonder...
There's two TextBoxes in a Wizard Step posing an either-or
situtation. Only one or the other TextBox may pass data. The
application also uses MasterPages.
Which tactic would you implement for the required validation when
there's two textboxes but only one may contain data? Any blogs on
this? So far search terms return nebulous results as my terms are
apparently too ambiguous.
--
<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL
http://clintongallagher.metromilwaukee.com/
MAP
http://wikimapia.org/#y=43038073&x=-88043838&z=17&l=0&m=h