Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare 2 Control Values??

Status
Not open for further replies.

SFDWeb

Programmer
May 13, 2005
7
US
I'm new to .NET (only two weeks!) and I have an ASP.NET application I'm working on and I can't find a solution to my problem so here I am asking for help!

I have a radio button group and a textbox on a form.

The radio button group does not have a preselected value and the textbox has no initial value.

When the user clicks the submit button I need to make sure they have either selected one of the radio buttons OR have entered something in the textbox.

How do I do this? I tried using the CompareValidator but that isn't working.

Thanx in advance!
 
Answer:

If RadioButtonList1.SelectedIndex <> -1 Or TextBox1.Text.Trim <> "" Then
' proceed ...
End If


Tip:

We use Vb.net (code-behide) but this question is for ASP.NET. Next time post in the asp section of this forum.
:)


-bclt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top