IsInList Method (.NET)

 

This method is used to determine whether a country represented by a CountryObj is within a list of countries you specify at run-time. For example, you can use this method to see if the visitor's country is either US, CA, UK, FR.

Syntax:

 bIsInList = chObj.IsInList(countryCodeList)

CountryCodeList must contain one or more valid two-letter country codes as defined in the countrynames.properties file, separated by spaces.

Returns:

True if the country represented by the CountryObj class is within the list of specified country codes, false otherwise.

VB.NET Example:

dim chObj as CountryObj = CountryObj.GetCountry()

Response.Write("Your country is ")

if (chObj.IsRestricted() = false)

Response.Write("NOT ")

end if

Response.Write("in our list.")

C# Example:

CountryObj chObj = CountryObj.GetCountry();

Response.Write("Your country is ");

if (chObj.IsRestricted() == false)

Response.Write("NOT ");

Response.Write("in our list.");