Error on if statement - cannot implicitly convert type to 'bool'

c# equality operator is == and not =:

if (thecitytype == "City1")

Here is some code in you can use with NUnit that demonstrates another technique for calculating listingToSearch - You will also notice that with this technique, you won't need to add extract if/else, etc as you add more cities - the test below demonstrates that the code will just try to read integer starting after "City" in the radio button label. Also, see the very bottom for what you could write in your main code

[Test]
public void testGetCityToSearch()
{

    // if thecitytype = "City1", listingToSearch = 1
    // if thecitytype = "City2", listingToSearch = 2

    doParseCity(1, "City1");
    doParseCity(2, "City2");
    doParseCity(20, "City20");        
}

public void doParseCity(int expected, string input )
{
    int listingsToSearch;
    string cityNum = input.Substring(4);
    bool parseResult = Int32.TryParse(cityNum, out listingsToSearch);
    Assert.IsTrue(parseResult);
    Assert.AreEqual(expected, listingsToSearch);
}

In your regular code you can just write:

string thecitytype20 = "City20";
string cityNum20 = thecitytype20.Substring(4);
bool parseResult20 = Int32.TryParse(cityNum20, out listingsToSearch);
// parseResult20 tells you whether parse succeeded, listingsToSearch will give you 20