To detect a visitor country I see this below code suggested in many forums, but I cant get it working.
modGlobal.ResolveCountry.ThreeLetterISORegionName<
Try this
Dictionary objDic = new Dictionary();
foreach (CultureInfo ObjCultureInfo in CultureInfo.GetCultures(CultureTypes.SpecificCultures))
{
RegionInfo objRegionInfo = new RegionInfo(ObjCultureInfo.Name);
if (!objDic.ContainsKey(objRegionInfo.EnglishName))
{
objDic.Add(objRegionInfo.EnglishName, objRegionInfo.TwoLetterISORegionName.ToLower());
}
}
var obj = objDic.OrderBy(p => p.Key );
foreach (KeyValuePair val in obj)
{
ddlCountries.Items.Add(new ListItem(val.Key, val.Value));
}
EnglishName
will return country name
From the IP see