&& question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good morning, everyone,

I have a textbox and a radio button and I am trying to run an IF statement
to check on the content of the textbox AND if one of the radio buttons is
checked and everytime I use the && it tells me "Invalid expression term
'&&'". Also, can you tell me what to use to check which property to use to
check which is the selected item in the radio buttons group?

The code I have is

if (txtSearch.Text.Length > 0) && (radSearch.SelectedIndex==0);

Thanks,


Antonio
 
if (txtSearch.Text.Length > 0) && (radSearch.SelectedIndex==0);


wrong brackets:

if (txtSearch.Text.Length > 0 && radSearch.SelectedIndex==0)
{
// do someting here
}

or if you really like many brackets and want to do some extra work ;-) :

if ((txtSearch.Text.Length > 0) && (radSearch.SelectedIndex==0))
{
// do someting here
}


hth
Markus
 
Thank you, Markus!

Antonio

Markus said:
wrong brackets:

if (txtSearch.Text.Length > 0 && radSearch.SelectedIndex==0)
{
// do someting here
}

or if you really like many brackets and want to do some extra work ;-) :

if ((txtSearch.Text.Length > 0) && (radSearch.SelectedIndex==0))
{
// do someting here
}


hth
Markus
 
Back
Top