Hello, this must be an easy one. I want to perform code based on the
selected item from a radio button in asp.net. I have the following
code:
// Setup Living Area
switch (true)
{
case radRental.Checked:
livingArea = "Rental Properties Listing";
break;
case radHome.Checked:
livingArea = "Home Property Listing";
break;
case radApartment.Checked:
livingArea = "Apartment Property Listing";
break;
default:
livingArea = "";
break;
}
I am getting an error stating "a constant value is expected" on each
item in the case statement. I know I must be missing a cast or
something, can someone help?
Thanks,
Adiel