INCLUDE_DATA

From time to time I need to have a country list to include in my websites. Of course searching the internet will find one that is ready to go. However there have been some changes in new countries and they are not included in those list. There for I have made here the list so someone else can benefit from it. From time to time I have the issue selecting my country as it is most of the times not listed as the island I live on became a country. So here the list for you to use:

Asp.net List with value the country name
[code language=”vb”]
<asp:ListItem Value="Afghanistan">Afghanistan</asp:ListItem>
<asp:ListItem Value="Åland Islands">Åland Islands</asp:ListItem>
<asp:ListItem Value="Albania">Albania</asp:ListItem>
<asp:ListItem Value="Algeria">Algeria</asp:ListItem>
<asp:ListItem Value="American Samoa">American Samoa</asp:ListItem>
<asp:ListItem Value="Andorra">Andorra</asp:ListItem>
<asp:ListItem Value="Angola">Angola</asp:ListItem>
<asp:ListItem Value="Anguilla">Anguilla</asp:ListItem>
<asp:ListItem Value="Antarctica">Antarctica</asp:ListItem>
<asp:ListItem Value="Antigua and Barbuda">Antigua and Barbuda</asp:ListItem>
<asp:ListItem Value="Argentina">Argentina</asp:ListItem>
<asp:ListItem Value="Armenia">Armenia</asp:ListItem>
<asp:ListItem Value="Aruba">Aruba</asp:ListItem>
<asp:ListItem Value="Australia">Australia</asp:ListItem>
<asp:ListItem Value="Austria">Austria</asp:ListItem>
<asp:ListItem Value="Azerbaijan">Azerbaijan</asp:ListItem>
<asp:ListItem Value="Bahamas">Bahamas</asp:ListItem>
<asp:ListItem Value="Bahrain">Bahrain</asp:ListItem>
<asp:ListItem Value="Bangladesh">Bangladesh</asp:ListItem>
<asp:ListItem Value="Barbados">Barbados</asp:ListItem>
<asp:ListItem Value="Belarus">Belarus</asp:ListItem>
<asp:ListItem Value="Belgium">Belgium</asp:ListItem>
<asp:ListItem Value="Belize">Belize</asp:ListItem>
<asp:ListItem Value="Benin">Benin</asp:ListItem>
<asp:ListItem Value="Bermuda">Bermuda</asp:ListItem>
<asp:ListItem Value="Bhutan">Bhutan</asp:ListItem>
<asp:ListItem Value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</asp:ListItem>
<asp:ListItem Value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</asp:ListItem>
<asp:ListItem Value="Bosnia and Herzegovina">Bosnia and Herzegovina</asp:ListItem>
<asp:ListItem Value="Botswana">Botswana</asp:ListItem>
<asp:ListItem Value="Bouvet Island">Bouvet Island</asp:ListItem>
<asp:ListItem Value="Brazil">Brazil</asp:ListItem>
<asp:ListItem Value="British Indian Ocean Territory">British Indian Ocean Territory</asp:ListItem>
<asp:ListItem Value="Brunei Darussalam">Brunei Darussalam</asp:ListItem>
<asp:ListItem Value="Bulgaria">Bulgaria</asp:ListItem>
<asp:ListItem Value="Burkina Faso">Burkina Faso</asp:ListItem>
<asp:ListItem Value="Burundi">Burundi</asp:ListItem>
<asp:ListItem Value="Cambodia">Cambodia</asp:ListItem>
<asp:ListItem Value="Cameroon">Cameroon</asp:ListItem>
<asp:ListItem Value="Canada">Canada</asp:ListItem>
<asp:ListItem Value="Cape Verde">Cape Verde</asp:ListItem>
<asp:ListItem Value="Cayman Islands">Cayman Islands</asp:ListItem>
<asp:ListItem Value="Central African Republic">Central African Republic</asp:ListItem>
<asp:ListItem Value="Chad">Chad</asp:ListItem>
<asp:ListItem Value="Chile">Chile</asp:ListItem>
<asp:ListItem Value="China">China</asp:ListItem>
<asp:ListItem Value="Christmas Island">Christmas Island</asp:ListItem>
<asp:ListItem Value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</asp:ListItem>
<asp:ListItem Value="Colombia">Colombia</asp:ListItem>
<asp:ListItem Value="Comoros">Comoros</asp:ListItem>
<asp:ListItem Value="Congo">Congo</asp:ListItem>
<asp:ListItem Value="Congo, the Democratic Republic of the">Congo, the Democratic Republic of the</asp:ListItem>
<asp:ListItem Value="Cook Islands">Cook Islands</asp:ListItem>
<asp:ListItem Value="Costa Rica">Costa Rica</asp:ListItem>
<asp:ListItem Value="Côte d’Ivoire">Côte d’Ivoire</asp:ListItem>
<asp:ListItem Value="Croatia">Croatia</asp:ListItem>
<asp:ListItem Value="Cuba">Cuba</asp:ListItem>
<asp:ListItem Value="Curaçao">Curaçao</asp:ListItem>
<asp:ListItem Value="Cyprus">Cyprus</asp:ListItem>
<asp:ListItem Value="Czech Republic">Czech Republic</asp:ListItem>
<asp:ListItem Value="Denmark">Denmark</asp:ListItem>
<asp:ListItem Value="Djibouti">Djibouti</asp:ListItem>
<asp:ListItem Value="Dominica">Dominica</asp:ListItem>
<asp:ListItem Value="Dominican Republic">Dominican Republic</asp:ListItem>
<asp:ListItem Value="Ecuador">Ecuador</asp:ListItem>
<asp:ListItem Value="Egypt">Egypt</asp:ListItem>
<asp:ListItem Value="El Salvador">El Salvador</asp:ListItem>
<asp:ListItem Value="Equatorial Guinea">Equatorial Guinea</asp:ListItem>
<asp:ListItem Value="Eritrea">Eritrea</asp:ListItem>
<asp:ListItem Value="Estonia">Estonia</asp:ListItem>
<asp:ListItem Value="Ethiopia">Ethiopia</asp:ListItem>
<asp:ListItem Value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</asp:ListItem>
<asp:ListItem Value="Faroe Islands">Faroe Islands</asp:ListItem>
<asp:ListItem Value="Fiji">Fiji</asp:ListItem>
<asp:ListItem Value="Finland">Finland</asp:ListItem>
<asp:ListItem Value="France">France</asp:ListItem>
<asp:ListItem Value="French Guiana">French Guiana</asp:ListItem>
<asp:ListItem Value="French Polynesia">French Polynesia</asp:ListItem>
<asp:ListItem Value="French Southern Territories">French Southern Territories</asp:ListItem>
<asp:ListItem Value="Gabon">Gabon</asp:ListItem>
<asp:ListItem Value="Gambia">Gambia</asp:ListItem>
<asp:ListItem Value="Georgia">Georgia</asp:ListItem>
<asp:ListItem Value="Germany">Germany</asp:ListItem>
<asp:ListItem Value="Ghana">Ghana</asp:ListItem>
<asp:ListItem Value="Gibraltar">Gibraltar</asp:ListItem>
<asp:ListItem Value="Greece">Greece</asp:ListItem>
<asp:ListItem Value="Greenland">Greenland</asp:ListItem>
<asp:ListItem Value="Grenada">Grenada</asp:ListItem>
<asp:ListItem Value="Guadeloupe">Guadeloupe</asp:ListItem>
<asp:ListItem Value="Guam">Guam</asp:ListItem>
<asp:ListItem Value="Guatemala">Guatemala</asp:ListItem>
<asp:ListItem Value="Guernsey">Guernsey</asp:ListItem>
<asp:ListItem Value="Guinea">Guinea</asp:ListItem>
<asp:ListItem Value="Guinea-Bissau">Guinea-Bissau</asp:ListItem>
<asp:ListItem Value="Guyana">Guyana</asp:ListItem>
<asp:ListItem Value="Haiti">Haiti</asp:ListItem>
<asp:ListItem Value="Heard Island and McDonald Islands">Heard Island and McDonald Islands</asp:ListItem>
<asp:ListItem Value="Holy See (Vatican City State)">Holy See (Vatican City State)</asp:ListItem>
<asp:ListItem Value="Honduras">Honduras</asp:ListItem>
<asp:ListItem Value="Hong Kong">Hong Kong</asp:ListItem>
<asp:ListItem Value="Hungary">Hungary</asp:ListItem>
<asp:ListItem Value="Iceland">Iceland</asp:ListItem>
<asp:ListItem Value="India">India</asp:ListItem>
<asp:ListItem Value="Indonesia">Indonesia</asp:ListItem>
<asp:ListItem Value="Iran, Islamic Republic of">Iran, Islamic Republic of</asp:ListItem>
<asp:ListItem Value="Iraq">Iraq</asp:ListItem>
<asp:ListItem Value="Ireland">Ireland</asp:ListItem>
<asp:ListItem Value="Isle of Man">Isle of Man</asp:ListItem>
<asp:ListItem Value="Israel">Israel</asp:ListItem>
<asp:ListItem Value="Italy">Italy</asp:ListItem>
<asp:ListItem Value="Jamaica">Jamaica</asp:ListItem>
<asp:ListItem Value="Japan">Japan</asp:ListItem>
<asp:ListItem Value="Jersey">Jersey</asp:ListItem>
<asp:ListItem Value="Jordan">Jordan</asp:ListItem>
<asp:ListItem Value="Kazakhstan">Kazakhstan</asp:ListItem>
<asp:ListItem Value="Kenya">Kenya</asp:ListItem>
<asp:ListItem Value="Kiribati">Kiribati</asp:ListItem>
<asp:ListItem Value="Korea, Democratic People’s Republic of">Korea, Democratic People’s Republic of</asp:ListItem>
<asp:ListItem Value="Korea, Republic of">Korea, Republic of</asp:ListItem>
<asp:ListItem Value="Kuwait">Kuwait</asp:ListItem>
<asp:ListItem Value="Kyrgyzstan">Kyrgyzstan</asp:ListItem>
<asp:ListItem Value="Lao Peoples Democratic Republic">Lao Peoples Democratic Republic</asp:ListItem>
<asp:ListItem Value="Latvia">Latvia</asp:ListItem>
<asp:ListItem Value="Lebanon">Lebanon</asp:ListItem>
<asp:ListItem Value="Lesotho">Lesotho</asp:ListItem>
<asp:ListItem Value="Liberia">Liberia</asp:ListItem>
<asp:ListItem Value="Libyan Arab Jamahiriya">Libyan Arab Jamahiriya</asp:ListItem>
<asp:ListItem Value="Liechtenstein">Liechtenstein</asp:ListItem>
<asp:ListItem Value="Lithuania">Lithuania</asp:ListItem>
<asp:ListItem Value="Luxembourg">Luxembourg</asp:ListItem>
<asp:ListItem Value="Macao">Macao</asp:ListItem>
<asp:ListItem Value="Macedonia, the former Yugoslav Republic of">Macedonia, the former Yugoslav Republic of</asp:ListItem>
<asp:ListItem Value="Madagascar">Madagascar</asp:ListItem>
<asp:ListItem Value="Malawi">Malawi</asp:ListItem>
<asp:ListItem Value="Malaysia">Malaysia</asp:ListItem>
<asp:ListItem Value="Maldives">Maldives</asp:ListItem>
<asp:ListItem Value="Mali">Mali</asp:ListItem>
<asp:ListItem Value="Malta">Malta</asp:ListItem>
<asp:ListItem Value="Marshall Islands">Marshall Islands</asp:ListItem>
<asp:ListItem Value="Martinique">Martinique</asp:ListItem>
<asp:ListItem Value="Mauritania">Mauritania</asp:ListItem>
<asp:ListItem Value="Mauritius">Mauritius</asp:ListItem>
<asp:ListItem Value="Mayotte">Mayotte</asp:ListItem>
<asp:ListItem Value="Mexico">Mexico</asp:ListItem>
<asp:ListItem Value="Micronesia, Federated States of">Micronesia, Federated States of</asp:ListItem>
<asp:ListItem Value="Moldova, Republic of">Moldova, Republic of</asp:ListItem>
<asp:ListItem Value="Monaco">Monaco</asp:ListItem>
<asp:ListItem Value="Mongolia">Mongolia</asp:ListItem>
<asp:ListItem Value="Montenegro">Montenegro</asp:ListItem>
<asp:ListItem Value="Montserrat">Montserrat</asp:ListItem>
<asp:ListItem Value="Morocco">Morocco</asp:ListItem>
<asp:ListItem Value="Mozambique">Mozambique</asp:ListItem>
<asp:ListItem Value="Myanmar">Myanmar</asp:ListItem>
<asp:ListItem Value="Namibia">Namibia</asp:ListItem>
<asp:ListItem Value="Nauru">Nauru</asp:ListItem>
<asp:ListItem Value="Nepal">Nepal</asp:ListItem>
<asp:ListItem Value="Netherlands">Netherlands</asp:ListItem>
<asp:ListItem Value="New Caledonia">New Caledonia</asp:ListItem>
<asp:ListItem Value="New Zealand">New Zealand</asp:ListItem>
<asp:ListItem Value="Nicaragua">Nicaragua</asp:ListItem>
<asp:ListItem Value="Niger">Niger</asp:ListItem>
<asp:ListItem Value="Nigeria">Nigeria</asp:ListItem>
<asp:ListItem Value="Niue">Niue</asp:ListItem>
<asp:ListItem Value="Norfolk Island">Norfolk Island</asp:ListItem>
<asp:ListItem Value="Northern Mariana Islands">Northern Mariana Islands</asp:ListItem>
<asp:ListItem Value="Norway">Norway</asp:ListItem>
<asp:ListItem Value="Oman">Oman</asp:ListItem>
<asp:ListItem Value="Pakistan">Pakistan</asp:ListItem>
<asp:ListItem Value="Palau">Palau</asp:ListItem>
<asp:ListItem Value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</asp:ListItem>
<asp:ListItem Value="Panama">Panama</asp:ListItem>
<asp:ListItem Value="Papua New Guinea">Papua New Guinea</asp:ListItem>
<asp:ListItem Value="Paraguay">Paraguay</asp:ListItem>
<asp:ListItem Value="Peru">Peru</asp:ListItem>
<asp:ListItem Value="Philippines">Philippines</asp:ListItem>
<asp:ListItem Value="Pitcairn">Pitcairn</asp:ListItem>
<asp:ListItem Value="Poland">Poland</asp:ListItem>
<asp:ListItem Value="Portugal">Portugal</asp:ListItem>
<asp:ListItem Value="Puerto Rico">Puerto Rico</asp:ListItem>
<asp:ListItem Value="Qatar">Qatar</asp:ListItem>
<asp:ListItem Value="Réunion">Réunion</asp:ListItem>
<asp:ListItem Value="Romania">Romania</asp:ListItem>
<asp:ListItem Value="Russian Federation">Russian Federation</asp:ListItem>
<asp:ListItem Value="Rwanda">Rwanda</asp:ListItem>
<asp:ListItem Value="Saint Barthélemy">Saint Barthélemy</asp:ListItem>
<asp:ListItem Value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</asp:ListItem>
<asp:ListItem Value="Saint Kitts and Nevis">Saint Kitts and Nevis</asp:ListItem>
<asp:ListItem Value="Saint Lucia">Saint Lucia</asp:ListItem>
<asp:ListItem Value="Saint Martin (French part)">Saint Martin (French part)</asp:ListItem>
<asp:ListItem Value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</asp:ListItem>
<asp:ListItem Value="Saint Vincent and the Grenadines">Saint Vincent and the Grenadines</asp:ListItem>
<asp:ListItem Value="Samoa">Samoa</asp:ListItem>
<asp:ListItem Value="San Marino">San Marino</asp:ListItem>
<asp:ListItem Value="Sao Tome and Principe">Sao Tome and Principe</asp:ListItem>
<asp:ListItem Value="Saudi Arabia">Saudi Arabia</asp:ListItem>
<asp:ListItem Value="Senegal">Senegal</asp:ListItem>
<asp:ListItem Value="Serbia">Serbia</asp:ListItem>
<asp:ListItem Value="Seychelles">Seychelles</asp:ListItem>
<asp:ListItem Value="Sierra Leone">Sierra Leone</asp:ListItem>
<asp:ListItem Value="Singapore">Singapore</asp:ListItem>
<asp:ListItem Value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</asp:ListItem>
<asp:ListItem Value="Slovakia">Slovakia</asp:ListItem>
<asp:ListItem Value="Slovenia">Slovenia</asp:ListItem>
<asp:ListItem Value="Solomon Islands">Solomon Islands</asp:ListItem>
<asp:ListItem Value="Somalia">Somalia</asp:ListItem>
<asp:ListItem Value="South Africa">South Africa</asp:ListItem>
<asp:ListItem Value="South Georgia and the South Sandwich Islands">South Georgia and the South Sandwich Islands</asp:ListItem>
<asp:ListItem Value="South Sudan">South Sudan</asp:ListItem>
<asp:ListItem Value="Spain">Spain</asp:ListItem>
<asp:ListItem Value="Sri Lanka">Sri Lanka</asp:ListItem>
<asp:ListItem Value="Sudan">Sudan</asp:ListItem>
<asp:ListItem Value="Suriname">Suriname</asp:ListItem>
<asp:ListItem Value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</asp:ListItem>
<asp:ListItem Value="Swaziland">Swaziland</asp:ListItem>
<asp:ListItem Value="Sweden">Sweden</asp:ListItem>
<asp:ListItem Value="Switzerland">Switzerland</asp:ListItem>
<asp:ListItem Value="Syrian Arab Republic">Syrian Arab Republic</asp:ListItem>
<asp:ListItem Value="Taiwan, Province of China">Taiwan, Province of China</asp:ListItem>
<asp:ListItem Value="Tajikistan">Tajikistan</asp:ListItem>
<asp:ListItem Value="Tanzania, United Republic of">Tanzania, United Republic of</asp:ListItem>
<asp:ListItem Value="Thailand">Thailand</asp:ListItem>
<asp:ListItem Value="Timor-Leste">Timor-Leste</asp:ListItem>
<asp:ListItem Value="Togo">Togo</asp:ListItem>
<asp:ListItem Value="Tokelau">Tokelau</asp:ListItem>
<asp:ListItem Value="Tonga">Tonga</asp:ListItem>
<asp:ListItem Value="Trinidad and Tobago">Trinidad and Tobago</asp:ListItem>
<asp:ListItem Value="Tunisia">Tunisia</asp:ListItem>
<asp:ListItem Value="Turkey">Turkey</asp:ListItem>
<asp:ListItem Value="Turkmenistan">Turkmenistan</asp:ListItem>
<asp:ListItem Value="Turks and Caicos Islands">Turks and Caicos Islands</asp:ListItem>
<asp:ListItem Value="Tuvalu">Tuvalu</asp:ListItem>
<asp:ListItem Value="Uganda">Uganda</asp:ListItem>
<asp:ListItem Value="Ukraine">Ukraine</asp:ListItem>
<asp:ListItem Value="United Arab Emirates">United Arab Emirates</asp:ListItem>
<asp:ListItem Value="United Kingdom">United Kingdom</asp:ListItem>
<asp:ListItem Value="United States">United States</asp:ListItem>
<asp:ListItem Value="United States Minor Outlying Islands">United States Minor Outlying Islands</asp:ListItem>
<asp:ListItem Value="Uruguay">Uruguay</asp:ListItem>
<asp:ListItem Value="Uzbekistan">Uzbekistan</asp:ListItem>
<asp:ListItem Value="Vanuatu">Vanuatu</asp:ListItem>
<asp:ListItem Value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</asp:ListItem>
<asp:ListItem Value="Viet Nam">Viet Nam</asp:ListItem>
<asp:ListItem Value="Virgin Islands, British">Virgin Islands, British</asp:ListItem>
<asp:ListItem Value="Virgin Islands, U.S.">Virgin Islands, U.S.</asp:ListItem>
<asp:ListItem Value="Wallis and Futuna">Wallis and Futuna</asp:ListItem>
<asp:ListItem Value="Western Sahara">Western Sahara</asp:ListItem>
<asp:ListItem Value="Yemen">Yemen</asp:ListItem>
<asp:ListItem Value="Zambia">Zambia</asp:ListItem>
<asp:ListItem Value="Zimbabwe">Zimbabwe</asp:ListItem>
[/code]

Asp.net Country List with value the two country Alpha-2 code
[code language=”vb”]
<asp:ListItem Value="AF">Afghanistan</asp:ListItem>
<asp:ListItem Value="AX">Åland Islands</asp:ListItem>
<asp:ListItem Value="AL">Albania</asp:ListItem>
<asp:ListItem Value="DZ">Algeria</asp:ListItem>
<asp:ListItem Value="AS">American Samoa</asp:ListItem>
<asp:ListItem Value="AD">Andorra</asp:ListItem>
<asp:ListItem Value="AO">Angola</asp:ListItem>
<asp:ListItem Value="AI">Anguilla</asp:ListItem>
<asp:ListItem Value="AQ">Antarctica</asp:ListItem>
<asp:ListItem Value="AG">Antigua and Barbuda</asp:ListItem>
<asp:ListItem Value="AR">Argentina</asp:ListItem>
<asp:ListItem Value="AM">Armenia</asp:ListItem>
<asp:ListItem Value="AW">Aruba</asp:ListItem>
<asp:ListItem Value="AU">Australia</asp:ListItem>
<asp:ListItem Value="AT">Austria</asp:ListItem>
<asp:ListItem Value="AZ">Azerbaijan</asp:ListItem>
<asp:ListItem Value="BS">Bahamas</asp:ListItem>
<asp:ListItem Value="BH">Bahrain</asp:ListItem>
<asp:ListItem Value="BD">Bangladesh</asp:ListItem>
<asp:ListItem Value="BB">Barbados</asp:ListItem>
<asp:ListItem Value="BY">Belarus</asp:ListItem>
<asp:ListItem Value="BE">Belgium</asp:ListItem>
<asp:ListItem Value="BZ">Belize</asp:ListItem>
<asp:ListItem Value="BJ">Benin</asp:ListItem>
<asp:ListItem Value="BM">Bermuda</asp:ListItem>
<asp:ListItem Value="BT">Bhutan</asp:ListItem>
<asp:ListItem Value="BO">Bolivia, Plurinational State of</asp:ListItem>
<asp:ListItem Value="BQ">Bonaire, Sint Eustatius and Saba</asp:ListItem>
<asp:ListItem Value="BA">Bosnia and Herzegovina</asp:ListItem>
<asp:ListItem Value="BW">Botswana</asp:ListItem>
<asp:ListItem Value="BV">Bouvet Island</asp:ListItem>
<asp:ListItem Value="BR">Brazil</asp:ListItem>
<asp:ListItem Value="IO">British Indian Ocean Territory</asp:ListItem>
<asp:ListItem Value="BN">Brunei Darussalam</asp:ListItem>
<asp:ListItem Value="BG">Bulgaria</asp:ListItem>
<asp:ListItem Value="BF">Burkina Faso</asp:ListItem>
<asp:ListItem Value="BI">Burundi</asp:ListItem>
<asp:ListItem Value="KH">Cambodia</asp:ListItem>
<asp:ListItem Value="CM">Cameroon</asp:ListItem>
<asp:ListItem Value="CA">Canada</asp:ListItem>
<asp:ListItem Value="CV">Cape Verde</asp:ListItem>
<asp:ListItem Value="KY">Cayman Islands</asp:ListItem>
<asp:ListItem Value="CF">Central African Republic</asp:ListItem>
<asp:ListItem Value="TD">Chad</asp:ListItem>
<asp:ListItem Value="CL">Chile</asp:ListItem>
<asp:ListItem Value="CN">China</asp:ListItem>
<asp:ListItem Value="CX">Christmas Island</asp:ListItem>
<asp:ListItem Value="CC">Cocos (Keeling) Islands</asp:ListItem>
<asp:ListItem Value="CO">Colombia</asp:ListItem>
<asp:ListItem Value="KM">Comoros</asp:ListItem>
<asp:ListItem Value="CG">Congo</asp:ListItem>
<asp:ListItem Value="CD">Congo, the Democratic Republic of the</asp:ListItem>
<asp:ListItem Value="CK">Cook Islands</asp:ListItem>
<asp:ListItem Value="CR">Costa Rica</asp:ListItem>
<asp:ListItem Value="CI">Côte d’Ivoire</asp:ListItem>
<asp:ListItem Value="HR">Croatia</asp:ListItem>
<asp:ListItem Value="CU">Cuba</asp:ListItem>
<asp:ListItem Value="CW">Curaçao</asp:ListItem>
<asp:ListItem Value="CY">Cyprus</asp:ListItem>
<asp:ListItem Value="CZ">Czech Republic</asp:ListItem>
<asp:ListItem Value="DK">Denmark</asp:ListItem>
<asp:ListItem Value="DJ">Djibouti</asp:ListItem>
<asp:ListItem Value="DM">Dominica</asp:ListItem>
<asp:ListItem Value="DO">Dominican Republic</asp:ListItem>
<asp:ListItem Value="EC">Ecuador</asp:ListItem>
<asp:ListItem Value="EG">Egypt</asp:ListItem>
<asp:ListItem Value="SV">El Salvador</asp:ListItem>
<asp:ListItem Value="GQ">Equatorial Guinea</asp:ListItem>
<asp:ListItem Value="ER">Eritrea</asp:ListItem>
<asp:ListItem Value="EE">Estonia</asp:ListItem>
<asp:ListItem Value="ET">Ethiopia</asp:ListItem>
<asp:ListItem Value="FK">Falkland Islands (Malvinas)</asp:ListItem>
<asp:ListItem Value="FO">Faroe Islands</asp:ListItem>
<asp:ListItem Value="FJ">Fiji</asp:ListItem>
<asp:ListItem Value="FI">Finland</asp:ListItem>
<asp:ListItem Value="FR">France</asp:ListItem>
<asp:ListItem Value="GF">French Guiana</asp:ListItem>
<asp:ListItem Value="PF">French Polynesia</asp:ListItem>
<asp:ListItem Value="TF">French Southern Territories</asp:ListItem>
<asp:ListItem Value="GA">Gabon</asp:ListItem>
<asp:ListItem Value="GM">Gambia</asp:ListItem>
<asp:ListItem Value="GE">Georgia</asp:ListItem>
<asp:ListItem Value="DE">Germany</asp:ListItem>
<asp:ListItem Value="GH">Ghana</asp:ListItem>
<asp:ListItem Value="GI">Gibraltar</asp:ListItem>
<asp:ListItem Value="GR">Greece</asp:ListItem>
<asp:ListItem Value="GL">Greenland</asp:ListItem>
<asp:ListItem Value="GD">Grenada</asp:ListItem>
<asp:ListItem Value="GP">Guadeloupe</asp:ListItem>
<asp:ListItem Value="GU">Guam</asp:ListItem>
<asp:ListItem Value="GT">Guatemala</asp:ListItem>
<asp:ListItem Value="GG">Guernsey</asp:ListItem>
<asp:ListItem Value="GN">Guinea</asp:ListItem>
<asp:ListItem Value="GW">Guinea-Bissau</asp:ListItem>
<asp:ListItem Value="GY">Guyana</asp:ListItem>
<asp:ListItem Value="HT">Haiti</asp:ListItem>
<asp:ListItem Value="HM">Heard Island and McDonald Islands</asp:ListItem>
<asp:ListItem Value="VA">Holy See (Vatican City State)</asp:ListItem>
<asp:ListItem Value="HN">Honduras</asp:ListItem>
<asp:ListItem Value="HK">Hong Kong</asp:ListItem>
<asp:ListItem Value="HU">Hungary</asp:ListItem>
<asp:ListItem Value="IS">Iceland</asp:ListItem>
<asp:ListItem Value="IN">India</asp:ListItem>
<asp:ListItem Value="ID">Indonesia</asp:ListItem>
<asp:ListItem Value="IR">Iran, Islamic Republic of</asp:ListItem>
<asp:ListItem Value="IQ">Iraq</asp:ListItem>
<asp:ListItem Value="IE">Ireland</asp:ListItem>
<asp:ListItem Value="IM">Isle of Man</asp:ListItem>
<asp:ListItem Value="IL">Israel</asp:ListItem>
<asp:ListItem Value="IT">Italy</asp:ListItem>
<asp:ListItem Value="JM">Jamaica</asp:ListItem>
<asp:ListItem Value="JP">Japan</asp:ListItem>
<asp:ListItem Value="JE">Jersey</asp:ListItem>
<asp:ListItem Value="JO">Jordan</asp:ListItem>
<asp:ListItem Value="KZ">Kazakhstan</asp:ListItem>
<asp:ListItem Value="KE">Kenya</asp:ListItem>
<asp:ListItem Value="KI">Kiribati</asp:ListItem>
<asp:ListItem Value="KP">Korea, Democratic People’s Republic of</asp:ListItem>
<asp:ListItem Value="KR">Korea, Republic of</asp:ListItem>
<asp:ListItem Value="KW">Kuwait</asp:ListItem>
<asp:ListItem Value="KG">Kyrgyzstan</asp:ListItem>
<asp:ListItem Value="LA">Lao Peoples Democratic Republic</asp:ListItem>
<asp:ListItem Value="LV">Latvia</asp:ListItem>
<asp:ListItem Value="LB">Lebanon</asp:ListItem>
<asp:ListItem Value="LS">Lesotho</asp:ListItem>
<asp:ListItem Value="LR">Liberia</asp:ListItem>
<asp:ListItem Value="LY">Libyan Arab Jamahiriya</asp:ListItem>
<asp:ListItem Value="LI">Liechtenstein</asp:ListItem>
<asp:ListItem Value="LT">Lithuania</asp:ListItem>
<asp:ListItem Value="LU">Luxembourg</asp:ListItem>
<asp:ListItem Value="MO">Macao</asp:ListItem>
<asp:ListItem Value="MK">Macedonia, the former Yugoslav Republic of</asp:ListItem>
<asp:ListItem Value="MG">Madagascar</asp:ListItem>
<asp:ListItem Value="MW">Malawi</asp:ListItem>
<asp:ListItem Value="MY">Malaysia</asp:ListItem>
<asp:ListItem Value="MV">Maldives</asp:ListItem>
<asp:ListItem Value="ML">Mali</asp:ListItem>
<asp:ListItem Value="MT">Malta</asp:ListItem>
<asp:ListItem Value="MH">Marshall Islands</asp:ListItem>
<asp:ListItem Value="MQ">Martinique</asp:ListItem>
<asp:ListItem Value="MR">Mauritania</asp:ListItem>
<asp:ListItem Value="MU">Mauritius</asp:ListItem>
<asp:ListItem Value="YT">Mayotte</asp:ListItem>
<asp:ListItem Value="MX">Mexico</asp:ListItem>
<asp:ListItem Value="FM">Micronesia, Federated States of</asp:ListItem>
<asp:ListItem Value="MD">Moldova, Republic of</asp:ListItem>
<asp:ListItem Value="MC">Monaco</asp:ListItem>
<asp:ListItem Value="MN">Mongolia</asp:ListItem>
<asp:ListItem Value="ME">Montenegro</asp:ListItem>
<asp:ListItem Value="MS">Montserrat</asp:ListItem>
<asp:ListItem Value="MA">Morocco</asp:ListItem>
<asp:ListItem Value="MZ">Mozambique</asp:ListItem>
<asp:ListItem Value="MM">Myanmar</asp:ListItem>
<asp:ListItem Value="NA">Namibia</asp:ListItem>
<asp:ListItem Value="NR">Nauru</asp:ListItem>
<asp:ListItem Value="NP">Nepal</asp:ListItem>
<asp:ListItem Value="NL">Netherlands</asp:ListItem>
<asp:ListItem Value="NC">New Caledonia</asp:ListItem>
<asp:ListItem Value="NZ">New Zealand</asp:ListItem>
<asp:ListItem Value="NI">Nicaragua</asp:ListItem>
<asp:ListItem Value="NE">Niger</asp:ListItem>
<asp:ListItem Value="NG">Nigeria</asp:ListItem>
<asp:ListItem Value="NU">Niue</asp:ListItem>
<asp:ListItem Value="NF">Norfolk Island</asp:ListItem>
<asp:ListItem Value="MP">Northern Mariana Islands</asp:ListItem>
<asp:ListItem Value="NO">Norway</asp:ListItem>
<asp:ListItem Value="OM">Oman</asp:ListItem>
<asp:ListItem Value="PK">Pakistan</asp:ListItem>
<asp:ListItem Value="PW">Palau</asp:ListItem>
<asp:ListItem Value="PS">Palestinian Territory, Occupied</asp:ListItem>
<asp:ListItem Value="PA">Panama</asp:ListItem>
<asp:ListItem Value="PG">Papua New Guinea</asp:ListItem>
<asp:ListItem Value="PY">Paraguay</asp:ListItem>
<asp:ListItem Value="PE">Peru</asp:ListItem>
<asp:ListItem Value="PH">Philippines</asp:ListItem>
<asp:ListItem Value="PN">Pitcairn</asp:ListItem>
<asp:ListItem Value="PL">Poland</asp:ListItem>
<asp:ListItem Value="PT">Portugal</asp:ListItem>
<asp:ListItem Value="PR">Puerto Rico</asp:ListItem>
<asp:ListItem Value="QA">Qatar</asp:ListItem>
<asp:ListItem Value="RE">Réunion</asp:ListItem>
<asp:ListItem Value="RO">Romania</asp:ListItem>
<asp:ListItem Value="RU">Russian Federation</asp:ListItem>
<asp:ListItem Value="RW">Rwanda</asp:ListItem>
<asp:ListItem Value="BL">Saint Barthélemy</asp:ListItem>
<asp:ListItem Value="SH">Saint Helena, Ascension and Tristan da Cunha</asp:ListItem>
<asp:ListItem Value="KN">Saint Kitts and Nevis</asp:ListItem>
<asp:ListItem Value="LC">Saint Lucia</asp:ListItem>
<asp:ListItem Value="MF">Saint Martin (French part)</asp:ListItem>
<asp:ListItem Value="PM">Saint Pierre and Miquelon</asp:ListItem>
<asp:ListItem Value="VC">Saint Vincent and the Grenadines</asp:ListItem>
<asp:ListItem Value="WS">Samoa</asp:ListItem>
<asp:ListItem Value="SM">San Marino</asp:ListItem>
<asp:ListItem Value="ST">Sao Tome and Principe</asp:ListItem>
<asp:ListItem Value="SA">Saudi Arabia</asp:ListItem>
<asp:ListItem Value="SN">Senegal</asp:ListItem>
<asp:ListItem Value="RS">Serbia</asp:ListItem>
<asp:ListItem Value="SC">Seychelles</asp:ListItem>
<asp:ListItem Value="SL">Sierra Leone</asp:ListItem>
<asp:ListItem Value="SG">Singapore</asp:ListItem>
<asp:ListItem Value="SX">Sint Maarten (Dutch part)</asp:ListItem>
<asp:ListItem Value="SK">Slovakia</asp:ListItem>
<asp:ListItem Value="SI">Slovenia</asp:ListItem>
<asp:ListItem Value="SB">Solomon Islands</asp:ListItem>
<asp:ListItem Value="SO">Somalia</asp:ListItem>
<asp:ListItem Value="ZA">South Africa</asp:ListItem>
<asp:ListItem Value="GS">South Georgia and the South Sandwich Islands</asp:ListItem>
<asp:ListItem Value="SS">South Sudan</asp:ListItem>
<asp:ListItem Value="ES">Spain</asp:ListItem>
<asp:ListItem Value="LK">Sri Lanka</asp:ListItem>
<asp:ListItem Value="SD">Sudan</asp:ListItem>
<asp:ListItem Value="SR">Suriname</asp:ListItem>
<asp:ListItem Value="SJ">Svalbard and Jan Mayen</asp:ListItem>
<asp:ListItem Value="SZ">Swaziland</asp:ListItem>
<asp:ListItem Value="SE">Sweden</asp:ListItem>
<asp:ListItem Value="CH">Switzerland</asp:ListItem>
<asp:ListItem Value="SY">Syrian Arab Republic</asp:ListItem>
<asp:ListItem Value="TW">Taiwan, Province of China</asp:ListItem>
<asp:ListItem Value="TJ">Tajikistan</asp:ListItem>
<asp:ListItem Value="TZ">Tanzania, United Republic of</asp:ListItem>
<asp:ListItem Value="TH">Thailand</asp:ListItem>
<asp:ListItem Value="TL">Timor-Leste</asp:ListItem>
<asp:ListItem Value="TG">Togo</asp:ListItem>
<asp:ListItem Value="TK">Tokelau</asp:ListItem>
<asp:ListItem Value="TO">Tonga</asp:ListItem>
<asp:ListItem Value="TT">Trinidad and Tobago</asp:ListItem>
<asp:ListItem Value="TN">Tunisia</asp:ListItem>
<asp:ListItem Value="TR">Turkey</asp:ListItem>
<asp:ListItem Value="TM">Turkmenistan</asp:ListItem>
<asp:ListItem Value="TC">Turks and Caicos Islands</asp:ListItem>
<asp:ListItem Value="TV">Tuvalu</asp:ListItem>
<asp:ListItem Value="UG">Uganda</asp:ListItem>
<asp:ListItem Value="UA">Ukraine</asp:ListItem>
<asp:ListItem Value="AE">United Arab Emirates</asp:ListItem>
<asp:ListItem Value="GB">United Kingdom</asp:ListItem>
<asp:ListItem Value="US">United States</asp:ListItem>
<asp:ListItem Value="UM">United States Minor Outlying Islands</asp:ListItem>
<asp:ListItem Value="UY">Uruguay</asp:ListItem>
<asp:ListItem Value="UZ">Uzbekistan</asp:ListItem>
<asp:ListItem Value="VU">Vanuatu</asp:ListItem>
<asp:ListItem Value="VE">Venezuela, Bolivarian Republic of</asp:ListItem>
<asp:ListItem Value="VN">Viet Nam</asp:ListItem>
<asp:ListItem Value="VG">Virgin Islands, British</asp:ListItem>
<asp:ListItem Value="VI">Virgin Islands, U.S.</asp:ListItem>
<asp:ListItem Value="WF">Wallis and Futuna</asp:ListItem>
<asp:ListItem Value="EH">Western Sahara</asp:ListItem>
<asp:ListItem Value="YE">Yemen</asp:ListItem>
<asp:ListItem Value="ZM">Zambia</asp:ListItem>
<asp:ListItem Value="ZW">Zimbabwe</asp:ListItem>
[/code]

Asp.net Country List with value the three country Alpha-3 code
[code language=”vb”]
<asp:ListItem Value="AFG">Afghanistan</asp:ListItem>
<asp:ListItem Value="ALA">Åland Islands</asp:ListItem>
<asp:ListItem Value="ALB">Albania</asp:ListItem>
<asp:ListItem Value="DZA">Algeria</asp:ListItem>
<asp:ListItem Value="ASM">American Samoa</asp:ListItem>
<asp:ListItem Value="AND">Andorra</asp:ListItem>
<asp:ListItem Value="AGO">Angola</asp:ListItem>
<asp:ListItem Value="AIA">Anguilla</asp:ListItem>
<asp:ListItem Value="ATA">Antarctica</asp:ListItem>
<asp:ListItem Value="ATG">Antigua and Barbuda</asp:ListItem>
<asp:ListItem Value="ARG">Argentina</asp:ListItem>
<asp:ListItem Value="ARM">Armenia</asp:ListItem>
<asp:ListItem Value="ABW">Aruba</asp:ListItem>
<asp:ListItem Value="AUS">Australia</asp:ListItem>
<asp:ListItem Value="AUT">Austria</asp:ListItem>
<asp:ListItem Value="AZE">Azerbaijan</asp:ListItem>
<asp:ListItem Value="BHS">Bahamas</asp:ListItem>
<asp:ListItem Value="BHR">Bahrain</asp:ListItem>
<asp:ListItem Value="BGD">Bangladesh</asp:ListItem>
<asp:ListItem Value="BRB">Barbados</asp:ListItem>
<asp:ListItem Value="BLR">Belarus</asp:ListItem>
<asp:ListItem Value="BEL">Belgium</asp:ListItem>
<asp:ListItem Value="BLZ">Belize</asp:ListItem>
<asp:ListItem Value="BEN">Benin</asp:ListItem>
<asp:ListItem Value="BMU">Bermuda</asp:ListItem>
<asp:ListItem Value="BTN">Bhutan</asp:ListItem>
<asp:ListItem Value="BOL">Bolivia, Plurinational State of</asp:ListItem>
<asp:ListItem Value="BES">Bonaire, Sint Eustatius and Saba</asp:ListItem>
<asp:ListItem Value="BIH">Bosnia and Herzegovina</asp:ListItem>
<asp:ListItem Value="BWA">Botswana</asp:ListItem>
<asp:ListItem Value="BVT">Bouvet Island</asp:ListItem>
<asp:ListItem Value="BRA">Brazil</asp:ListItem>
<asp:ListItem Value="IOT">British Indian Ocean Territory</asp:ListItem>
<asp:ListItem Value="BRN">Brunei Darussalam</asp:ListItem>
<asp:ListItem Value="BGR">Bulgaria</asp:ListItem>
<asp:ListItem Value="BFA">Burkina Faso</asp:ListItem>
<asp:ListItem Value="BDI">Burundi</asp:ListItem>
<asp:ListItem Value="KHM">Cambodia</asp:ListItem>
<asp:ListItem Value="CMR">Cameroon</asp:ListItem>
<asp:ListItem Value="CAN">Canada</asp:ListItem>
<asp:ListItem Value="CPV">Cape Verde</asp:ListItem>
<asp:ListItem Value="CYM">Cayman Islands</asp:ListItem>
<asp:ListItem Value="CAF">Central African Republic</asp:ListItem>
<asp:ListItem Value="TCD">Chad</asp:ListItem>
<asp:ListItem Value="CHL">Chile</asp:ListItem>
<asp:ListItem Value="CHN">China</asp:ListItem>
<asp:ListItem Value="CXR">Christmas Island</asp:ListItem>
<asp:ListItem Value="CCK">Cocos (Keeling) Islands</asp:ListItem>
<asp:ListItem Value="COL">Colombia</asp:ListItem>
<asp:ListItem Value="COM">Comoros</asp:ListItem>
<asp:ListItem Value="COG">Congo</asp:ListItem>
<asp:ListItem Value="COD">Congo, the Democratic Republic of the</asp:ListItem>
<asp:ListItem Value="COK">Cook Islands</asp:ListItem>
<asp:ListItem Value="CRI">Costa Rica</asp:ListItem>
<asp:ListItem Value="CIV">Côte d’Ivoire</asp:ListItem>
<asp:ListItem Value="HRV">Croatia</asp:ListItem>
<asp:ListItem Value="CUB">Cuba</asp:ListItem>
<asp:ListItem Value="CUW">Curaçao</asp:ListItem>
<asp:ListItem Value="CYP">Cyprus</asp:ListItem>
<asp:ListItem Value="CZE">Czech Republic</asp:ListItem>
<asp:ListItem Value="DNK">Denmark</asp:ListItem>
<asp:ListItem Value="DJI">Djibouti</asp:ListItem>
<asp:ListItem Value="DMA">Dominica</asp:ListItem>
<asp:ListItem Value="DOM">Dominican Republic</asp:ListItem>
<asp:ListItem Value="ECU">Ecuador</asp:ListItem>
<asp:ListItem Value="EGY">Egypt</asp:ListItem>
<asp:ListItem Value="SLV">El Salvador</asp:ListItem>
<asp:ListItem Value="GNQ">Equatorial Guinea</asp:ListItem>
<asp:ListItem Value="ERI">Eritrea</asp:ListItem>
<asp:ListItem Value="EST">Estonia</asp:ListItem>
<asp:ListItem Value="ETH">Ethiopia</asp:ListItem>
<asp:ListItem Value="FLK">Falkland Islands (Malvinas)</asp:ListItem>
<asp:ListItem Value="FRO">Faroe Islands</asp:ListItem>
<asp:ListItem Value="FJI">Fiji</asp:ListItem>
<asp:ListItem Value="FIN">Finland</asp:ListItem>
<asp:ListItem Value="FRA">France</asp:ListItem>
<asp:ListItem Value="GUF">French Guiana</asp:ListItem>
<asp:ListItem Value="PYF">French Polynesia</asp:ListItem>
<asp:ListItem Value="ATF">French Southern Territories</asp:ListItem>
<asp:ListItem Value="GAB">Gabon</asp:ListItem>
<asp:ListItem Value="GMB">Gambia</asp:ListItem>
<asp:ListItem Value="GEO">Georgia</asp:ListItem>
<asp:ListItem Value="DEU">Germany</asp:ListItem>
<asp:ListItem Value="GHA">Ghana</asp:ListItem>
<asp:ListItem Value="GIB">Gibraltar</asp:ListItem>
<asp:ListItem Value="GRC">Greece</asp:ListItem>
<asp:ListItem Value="GRL">Greenland</asp:ListItem>
<asp:ListItem Value="GRD">Grenada</asp:ListItem>
<asp:ListItem Value="GLP">Guadeloupe</asp:ListItem>
<asp:ListItem Value="GUM">Guam</asp:ListItem>
<asp:ListItem Value="GTM">Guatemala</asp:ListItem>
<asp:ListItem Value="GGY">Guernsey</asp:ListItem>
<asp:ListItem Value="GIN">Guinea</asp:ListItem>
<asp:ListItem Value="GNB">Guinea-Bissau</asp:ListItem>
<asp:ListItem Value="GUY">Guyana</asp:ListItem>
<asp:ListItem Value="HTI">Haiti</asp:ListItem>
<asp:ListItem Value="HMD">Heard Island and McDonald Islands</asp:ListItem>
<asp:ListItem Value="VAT">Holy See (Vatican City State)</asp:ListItem>
<asp:ListItem Value="HND">Honduras</asp:ListItem>
<asp:ListItem Value="HKG">Hong Kong</asp:ListItem>
<asp:ListItem Value="HUN">Hungary</asp:ListItem>
<asp:ListItem Value="ISL">Iceland</asp:ListItem>
<asp:ListItem Value="IND">India</asp:ListItem>
<asp:ListItem Value="IDN">Indonesia</asp:ListItem>
<asp:ListItem Value="IRN">Iran, Islamic Republic of</asp:ListItem>
<asp:ListItem Value="IRQ">Iraq</asp:ListItem>
<asp:ListItem Value="IRL">Ireland</asp:ListItem>
<asp:ListItem Value="IMN">Isle of Man</asp:ListItem>
<asp:ListItem Value="ISR">Israel</asp:ListItem>
<asp:ListItem Value="ITA">Italy</asp:ListItem>
<asp:ListItem Value="JAM">Jamaica</asp:ListItem>
<asp:ListItem Value="JPN">Japan</asp:ListItem>
<asp:ListItem Value="JEY">Jersey</asp:ListItem>
<asp:ListItem Value="JOR">Jordan</asp:ListItem>
<asp:ListItem Value="KAZ">Kazakhstan</asp:ListItem>
<asp:ListItem Value="KEN">Kenya</asp:ListItem>
<asp:ListItem Value="KIR">Kiribati</asp:ListItem>
<asp:ListItem Value="PRK">Korea, Democratic People’s Republic of</asp:ListItem>
<asp:ListItem Value="KOR">Korea, Republic of</asp:ListItem>
<asp:ListItem Value="KWT">Kuwait</asp:ListItem>
<asp:ListItem Value="KGZ">Kyrgyzstan</asp:ListItem>
<asp:ListItem Value="LAO">Lao Peoples Democratic Republic</asp:ListItem>
<asp:ListItem Value="LVA">Latvia</asp:ListItem>
<asp:ListItem Value="LBN">Lebanon</asp:ListItem>
<asp:ListItem Value="LSO">Lesotho</asp:ListItem>
<asp:ListItem Value="LBR">Liberia</asp:ListItem>
<asp:ListItem Value="LBY">Libyan Arab Jamahiriya</asp:ListItem>
<asp:ListItem Value="LIE">Liechtenstein</asp:ListItem>
<asp:ListItem Value="LTU">Lithuania</asp:ListItem>
<asp:ListItem Value="LUX">Luxembourg</asp:ListItem>
<asp:ListItem Value="MAC">Macao</asp:ListItem>
<asp:ListItem Value="MKD">Macedonia, the former Yugoslav Republic of</asp:ListItem>
<asp:ListItem Value="MDG">Madagascar</asp:ListItem>
<asp:ListItem Value="MWI">Malawi</asp:ListItem>
<asp:ListItem Value="MYS">Malaysia</asp:ListItem>
<asp:ListItem Value="MDV">Maldives</asp:ListItem>
<asp:ListItem Value="MLI">Mali</asp:ListItem>
<asp:ListItem Value="MLT">Malta</asp:ListItem>
<asp:ListItem Value="MHL">Marshall Islands</asp:ListItem>
<asp:ListItem Value="MTQ">Martinique</asp:ListItem>
<asp:ListItem Value="MRT">Mauritania</asp:ListItem>
<asp:ListItem Value="MUS">Mauritius</asp:ListItem>
<asp:ListItem Value="MYT">Mayotte</asp:ListItem>
<asp:ListItem Value="MEX">Mexico</asp:ListItem>
<asp:ListItem Value="FSM">Micronesia, Federated States of</asp:ListItem>
<asp:ListItem Value="MDA">Moldova, Republic of</asp:ListItem>
<asp:ListItem Value="MCO">Monaco</asp:ListItem>
<asp:ListItem Value="MNG">Mongolia</asp:ListItem>
<asp:ListItem Value="MNE">Montenegro</asp:ListItem>
<asp:ListItem Value="MSR">Montserrat</asp:ListItem>
<asp:ListItem Value="MAR">Morocco</asp:ListItem>
<asp:ListItem Value="MOZ">Mozambique</asp:ListItem>
<asp:ListItem Value="MMR">Myanmar</asp:ListItem>
<asp:ListItem Value="NAM">Namibia</asp:ListItem>
<asp:ListItem Value="NRU">Nauru</asp:ListItem>
<asp:ListItem Value="NPL">Nepal</asp:ListItem>
<asp:ListItem Value="NLD">Netherlands</asp:ListItem>
<asp:ListItem Value="NCL">New Caledonia</asp:ListItem>
<asp:ListItem Value="NZL">New Zealand</asp:ListItem>
<asp:ListItem Value="NIC">Nicaragua</asp:ListItem>
<asp:ListItem Value="NER">Niger</asp:ListItem>
<asp:ListItem Value="NGA">Nigeria</asp:ListItem>
<asp:ListItem Value="NIU">Niue</asp:ListItem>
<asp:ListItem Value="NFK">Norfolk Island</asp:ListItem>
<asp:ListItem Value="MNP">Northern Mariana Islands</asp:ListItem>
<asp:ListItem Value="NOR">Norway</asp:ListItem>
<asp:ListItem Value="OMN">Oman</asp:ListItem>
<asp:ListItem Value="PAK">Pakistan</asp:ListItem>
<asp:ListItem Value="PLW">Palau</asp:ListItem>
<asp:ListItem Value="PSE">Palestinian Territory, Occupied</asp:ListItem>
<asp:ListItem Value="PAN">Panama</asp:ListItem>
<asp:ListItem Value="PNG">Papua New Guinea</asp:ListItem>
<asp:ListItem Value="PRY">Paraguay</asp:ListItem>
<asp:ListItem Value="PER">Peru</asp:ListItem>
<asp:ListItem Value="PHL">Philippines</asp:ListItem>
<asp:ListItem Value="PCN">Pitcairn</asp:ListItem>
<asp:ListItem Value="POL">Poland</asp:ListItem>
<asp:ListItem Value="PRT">Portugal</asp:ListItem>
<asp:ListItem Value="PRI">Puerto Rico</asp:ListItem>
<asp:ListItem Value="QAT">Qatar</asp:ListItem>
<asp:ListItem Value="REU">Réunion</asp:ListItem>
<asp:ListItem Value="ROU">Romania</asp:ListItem>
<asp:ListItem Value="RUS">Russian Federation</asp:ListItem>
<asp:ListItem Value="RWA">Rwanda</asp:ListItem>
<asp:ListItem Value="BLM">Saint Barthélemy</asp:ListItem>
<asp:ListItem Value="SHN">Saint Helena, Ascension and Tristan da Cunha</asp:ListItem>
<asp:ListItem Value="KNA">Saint Kitts and Nevis</asp:ListItem>
<asp:ListItem Value="LCA">Saint Lucia</asp:ListItem>
<asp:ListItem Value="MAF">Saint Martin (French part)</asp:ListItem>
<asp:ListItem Value="SPM">Saint Pierre and Miquelon</asp:ListItem>
<asp:ListItem Value="VCT">Saint Vincent and the Grenadines</asp:ListItem>
<asp:ListItem Value="WSM">Samoa</asp:ListItem>
<asp:ListItem Value="SMR">San Marino</asp:ListItem>
<asp:ListItem Value="STP">Sao Tome and Principe</asp:ListItem>
<asp:ListItem Value="SAU">Saudi Arabia</asp:ListItem>
<asp:ListItem Value="SEN">Senegal</asp:ListItem>
<asp:ListItem Value="SRB">Serbia</asp:ListItem>
<asp:ListItem Value="SYC">Seychelles</asp:ListItem>
<asp:ListItem Value="SLE">Sierra Leone</asp:ListItem>
<asp:ListItem Value="SGP">Singapore</asp:ListItem>
<asp:ListItem Value="SXM">Sint Maarten (Dutch part)</asp:ListItem>
<asp:ListItem Value="SVK">Slovakia</asp:ListItem>
<asp:ListItem Value="SVN">Slovenia</asp:ListItem>
<asp:ListItem Value="SLB">Solomon Islands</asp:ListItem>
<asp:ListItem Value="SOM">Somalia</asp:ListItem>
<asp:ListItem Value="ZAF">South Africa</asp:ListItem>
<asp:ListItem Value="SGS">South Georgia and the South Sandwich Islands</asp:ListItem>
<asp:ListItem Value="SSD">South Sudan</asp:ListItem>
<asp:ListItem Value="ESP">Spain</asp:ListItem>
<asp:ListItem Value="LKA">Sri Lanka</asp:ListItem>
<asp:ListItem Value="SDN">Sudan</asp:ListItem>
<asp:ListItem Value="SUR">Suriname</asp:ListItem>
<asp:ListItem Value="SJM">Svalbard and Jan Mayen</asp:ListItem>
<asp:ListItem Value="SWZ">Swaziland</asp:ListItem>
<asp:ListItem Value="SWE">Sweden</asp:ListItem>
<asp:ListItem Value="CHE">Switzerland</asp:ListItem>
<asp:ListItem Value="SYR">Syrian Arab Republic</asp:ListItem>
<asp:ListItem Value="TWN">Taiwan, Province of China</asp:ListItem>
<asp:ListItem Value="TJK">Tajikistan</asp:ListItem>
<asp:ListItem Value="TZA">Tanzania, United Republic of</asp:ListItem>
<asp:ListItem Value="THA">Thailand</asp:ListItem>
<asp:ListItem Value="TLS">Timor-Leste</asp:ListItem>
<asp:ListItem Value="TGO">Togo</asp:ListItem>
<asp:ListItem Value="TKL">Tokelau</asp:ListItem>
<asp:ListItem Value="TON">Tonga</asp:ListItem>
<asp:ListItem Value="TTO">Trinidad and Tobago</asp:ListItem>
<asp:ListItem Value="TUN">Tunisia</asp:ListItem>
<asp:ListItem Value="TUR">Turkey</asp:ListItem>
<asp:ListItem Value="TKM">Turkmenistan</asp:ListItem>
<asp:ListItem Value="TCA">Turks and Caicos Islands</asp:ListItem>
<asp:ListItem Value="TUV">Tuvalu</asp:ListItem>
<asp:ListItem Value="UGA">Uganda</asp:ListItem>
<asp:ListItem Value="UKR">Ukraine</asp:ListItem>
<asp:ListItem Value="ARE">United Arab Emirates</asp:ListItem>
<asp:ListItem Value="GBR">United Kingdom</asp:ListItem>
<asp:ListItem Value="USA">United States</asp:ListItem>
<asp:ListItem Value="UMI">United States Minor Outlying Islands</asp:ListItem>
<asp:ListItem Value="URY">Uruguay</asp:ListItem>
<asp:ListItem Value="UZB">Uzbekistan</asp:ListItem>
<asp:ListItem Value="VUT">Vanuatu</asp:ListItem>
<asp:ListItem Value="VEN">Venezuela, Bolivarian Republic of</asp:ListItem>
<asp:ListItem Value="VNM">Viet Nam</asp:ListItem>
<asp:ListItem Value="VGB">Virgin Islands, British</asp:ListItem>
<asp:ListItem Value="VIR">Virgin Islands, U.S.</asp:ListItem>
<asp:ListItem Value="WLF">Wallis and Futuna</asp:ListItem>
<asp:ListItem Value="ESH">Western Sahara</asp:ListItem>
<asp:ListItem Value="YEM">Yemen</asp:ListItem>
<asp:ListItem Value="ZMB">Zambia</asp:ListItem>
<asp:ListItem Value="ZWE">Zimbabwe</asp:ListItem>
[/code]

Asp.net Country List with value the country numeric code
[code language=”vb”]
<asp:ListItem Value="4">Afghanistan</asp:ListItem>
<asp:ListItem Value="248">Åland Islands</asp:ListItem>
<asp:ListItem Value="8">Albania</asp:ListItem>
<asp:ListItem Value="12">Algeria</asp:ListItem>
<asp:ListItem Value="16">American Samoa</asp:ListItem>
<asp:ListItem Value="20">Andorra</asp:ListItem>
<asp:ListItem Value="24">Angola</asp:ListItem>
<asp:ListItem Value="660">Anguilla</asp:ListItem>
<asp:ListItem Value="10">Antarctica</asp:ListItem>
<asp:ListItem Value="28">Antigua and Barbuda</asp:ListItem>
<asp:ListItem Value="32">Argentina</asp:ListItem>
<asp:ListItem Value="51">Armenia</asp:ListItem>
<asp:ListItem Value="533">Aruba</asp:ListItem>
<asp:ListItem Value="36">Australia</asp:ListItem>
<asp:ListItem Value="40">Austria</asp:ListItem>
<asp:ListItem Value="31">Azerbaijan</asp:ListItem>
<asp:ListItem Value="44">Bahamas</asp:ListItem>
<asp:ListItem Value="48">Bahrain</asp:ListItem>
<asp:ListItem Value="50">Bangladesh</asp:ListItem>
<asp:ListItem Value="52">Barbados</asp:ListItem>
<asp:ListItem Value="112">Belarus</asp:ListItem>
<asp:ListItem Value="56">Belgium</asp:ListItem>
<asp:ListItem Value="84">Belize</asp:ListItem>
<asp:ListItem Value="204">Benin</asp:ListItem>
<asp:ListItem Value="60">Bermuda</asp:ListItem>
<asp:ListItem Value="64">Bhutan</asp:ListItem>
<asp:ListItem Value="68">Bolivia, Plurinational State of</asp:ListItem>
<asp:ListItem Value="535">Bonaire, Sint Eustatius and Saba</asp:ListItem>
<asp:ListItem Value="70">Bosnia and Herzegovina</asp:ListItem>
<asp:ListItem Value="72">Botswana</asp:ListItem>
<asp:ListItem Value="74">Bouvet Island</asp:ListItem>
<asp:ListItem Value="76">Brazil</asp:ListItem>
<asp:ListItem Value="86">British Indian Ocean Territory</asp:ListItem>
<asp:ListItem Value="96">Brunei Darussalam</asp:ListItem>
<asp:ListItem Value="100">Bulgaria</asp:ListItem>
<asp:ListItem Value="854">Burkina Faso</asp:ListItem>
<asp:ListItem Value="108">Burundi</asp:ListItem>
<asp:ListItem Value="116">Cambodia</asp:ListItem>
<asp:ListItem Value="120">Cameroon</asp:ListItem>
<asp:ListItem Value="124">Canada</asp:ListItem>
<asp:ListItem Value="132">Cape Verde</asp:ListItem>
<asp:ListItem Value="136">Cayman Islands</asp:ListItem>
<asp:ListItem Value="140">Central African Republic</asp:ListItem>
<asp:ListItem Value="148">Chad</asp:ListItem>
<asp:ListItem Value="152">Chile</asp:ListItem>
<asp:ListItem Value="156">China</asp:ListItem>
<asp:ListItem Value="162">Christmas Island</asp:ListItem>
<asp:ListItem Value="166">Cocos (Keeling) Islands</asp:ListItem>
<asp:ListItem Value="170">Colombia</asp:ListItem>
<asp:ListItem Value="174">Comoros</asp:ListItem>
<asp:ListItem Value="178">Congo</asp:ListItem>
<asp:ListItem Value="180">Congo, the Democratic Republic of the</asp:ListItem>
<asp:ListItem Value="184">Cook Islands</asp:ListItem>
<asp:ListItem Value="188">Costa Rica</asp:ListItem>
<asp:ListItem Value="384">Côte d’Ivoire</asp:ListItem>
<asp:ListItem Value="191">Croatia</asp:ListItem>
<asp:ListItem Value="192">Cuba</asp:ListItem>
<asp:ListItem Value="531">Curaçao</asp:ListItem>
<asp:ListItem Value="196">Cyprus</asp:ListItem>
<asp:ListItem Value="203">Czech Republic</asp:ListItem>
<asp:ListItem Value="208">Denmark</asp:ListItem>
<asp:ListItem Value="262">Djibouti</asp:ListItem>
<asp:ListItem Value="212">Dominica</asp:ListItem>
<asp:ListItem Value="214">Dominican Republic</asp:ListItem>
<asp:ListItem Value="218">Ecuador</asp:ListItem>
<asp:ListItem Value="818">Egypt</asp:ListItem>
<asp:ListItem Value="222">El Salvador</asp:ListItem>
<asp:ListItem Value="226">Equatorial Guinea</asp:ListItem>
<asp:ListItem Value="232">Eritrea</asp:ListItem>
<asp:ListItem Value="233">Estonia</asp:ListItem>
<asp:ListItem Value="231">Ethiopia</asp:ListItem>
<asp:ListItem Value="238">Falkland Islands (Malvinas)</asp:ListItem>
<asp:ListItem Value="234">Faroe Islands</asp:ListItem>
<asp:ListItem Value="242">Fiji</asp:ListItem>
<asp:ListItem Value="246">Finland</asp:ListItem>
<asp:ListItem Value="250">France</asp:ListItem>
<asp:ListItem Value="254">French Guiana</asp:ListItem>
<asp:ListItem Value="258">French Polynesia</asp:ListItem>
<asp:ListItem Value="260">French Southern Territories</asp:ListItem>
<asp:ListItem Value="266">Gabon</asp:ListItem>
<asp:ListItem Value="270">Gambia</asp:ListItem>
<asp:ListItem Value="268">Georgia</asp:ListItem>
<asp:ListItem Value="276">Germany</asp:ListItem>
<asp:ListItem Value="288">Ghana</asp:ListItem>
<asp:ListItem Value="292">Gibraltar</asp:ListItem>
<asp:ListItem Value="300">Greece</asp:ListItem>
<asp:ListItem Value="304">Greenland</asp:ListItem>
<asp:ListItem Value="308">Grenada</asp:ListItem>
<asp:ListItem Value="312">Guadeloupe</asp:ListItem>
<asp:ListItem Value="316">Guam</asp:ListItem>
<asp:ListItem Value="320">Guatemala</asp:ListItem>
<asp:ListItem Value="831">Guernsey</asp:ListItem>
<asp:ListItem Value="324">Guinea</asp:ListItem>
<asp:ListItem Value="624">Guinea-Bissau</asp:ListItem>
<asp:ListItem Value="328">Guyana</asp:ListItem>
<asp:ListItem Value="332">Haiti</asp:ListItem>
<asp:ListItem Value="334">Heard Island and McDonald Islands</asp:ListItem>
<asp:ListItem Value="336">Holy See (Vatican City State)</asp:ListItem>
<asp:ListItem Value="340">Honduras</asp:ListItem>
<asp:ListItem Value="344">Hong Kong</asp:ListItem>
<asp:ListItem Value="348">Hungary</asp:ListItem>
<asp:ListItem Value="352">Iceland</asp:ListItem>
<asp:ListItem Value="356">India</asp:ListItem>
<asp:ListItem Value="360">Indonesia</asp:ListItem>
<asp:ListItem Value="364">Iran, Islamic Republic of</asp:ListItem>
<asp:ListItem Value="368">Iraq</asp:ListItem>
<asp:ListItem Value="372">Ireland</asp:ListItem>
<asp:ListItem Value="833">Isle of Man</asp:ListItem>
<asp:ListItem Value="376">Israel</asp:ListItem>
<asp:ListItem Value="380">Italy</asp:ListItem>
<asp:ListItem Value="388">Jamaica</asp:ListItem>
<asp:ListItem Value="392">Japan</asp:ListItem>
<asp:ListItem Value="832">Jersey</asp:ListItem>
<asp:ListItem Value="400">Jordan</asp:ListItem>
<asp:ListItem Value="398">Kazakhstan</asp:ListItem>
<asp:ListItem Value="404">Kenya</asp:ListItem>
<asp:ListItem Value="296">Kiribati</asp:ListItem>
<asp:ListItem Value="408">Korea, Democratic People’s Republic of</asp:ListItem>
<asp:ListItem Value="410">Korea, Republic of</asp:ListItem>
<asp:ListItem Value="414">Kuwait</asp:ListItem>
<asp:ListItem Value="417">Kyrgyzstan</asp:ListItem>
<asp:ListItem Value="418">Lao Peoples Democratic Republic</asp:ListItem>
<asp:ListItem Value="428">Latvia</asp:ListItem>
<asp:ListItem Value="422">Lebanon</asp:ListItem>
<asp:ListItem Value="426">Lesotho</asp:ListItem>
<asp:ListItem Value="430">Liberia</asp:ListItem>
<asp:ListItem Value="434">Libyan Arab Jamahiriya</asp:ListItem>
<asp:ListItem Value="438">Liechtenstein</asp:ListItem>
<asp:ListItem Value="440">Lithuania</asp:ListItem>
<asp:ListItem Value="442">Luxembourg</asp:ListItem>
<asp:ListItem Value="446">Macao</asp:ListItem>
<asp:ListItem Value="807">Macedonia, the former Yugoslav Republic of</asp:ListItem>
<asp:ListItem Value="450">Madagascar</asp:ListItem>
<asp:ListItem Value="454">Malawi</asp:ListItem>
<asp:ListItem Value="458">Malaysia</asp:ListItem>
<asp:ListItem Value="462">Maldives</asp:ListItem>
<asp:ListItem Value="466">Mali</asp:ListItem>
<asp:ListItem Value="470">Malta</asp:ListItem>
<asp:ListItem Value="584">Marshall Islands</asp:ListItem>
<asp:ListItem Value="474">Martinique</asp:ListItem>
<asp:ListItem Value="478">Mauritania</asp:ListItem>
<asp:ListItem Value="480">Mauritius</asp:ListItem>
<asp:ListItem Value="175">Mayotte</asp:ListItem>
<asp:ListItem Value="484">Mexico</asp:ListItem>
<asp:ListItem Value="583">Micronesia, Federated States of</asp:ListItem>
<asp:ListItem Value="498">Moldova, Republic of</asp:ListItem>
<asp:ListItem Value="492">Monaco</asp:ListItem>
<asp:ListItem Value="496">Mongolia</asp:ListItem>
<asp:ListItem Value="499">Montenegro</asp:ListItem>
<asp:ListItem Value="500">Montserrat</asp:ListItem>
<asp:ListItem Value="504">Morocco</asp:ListItem>
<asp:ListItem Value="508">Mozambique</asp:ListItem>
<asp:ListItem Value="104">Myanmar</asp:ListItem>
<asp:ListItem Value="516">Namibia</asp:ListItem>
<asp:ListItem Value="520">Nauru</asp:ListItem>
<asp:ListItem Value="524">Nepal</asp:ListItem>
<asp:ListItem Value="528">Netherlands</asp:ListItem>
<asp:ListItem Value="540">New Caledonia</asp:ListItem>
<asp:ListItem Value="554">New Zealand</asp:ListItem>
<asp:ListItem Value="558">Nicaragua</asp:ListItem>
<asp:ListItem Value="562">Niger</asp:ListItem>
<asp:ListItem Value="566">Nigeria</asp:ListItem>
<asp:ListItem Value="570">Niue</asp:ListItem>
<asp:ListItem Value="574">Norfolk Island</asp:ListItem>
<asp:ListItem Value="580">Northern Mariana Islands</asp:ListItem>
<asp:ListItem Value="578">Norway</asp:ListItem>
<asp:ListItem Value="512">Oman</asp:ListItem>
<asp:ListItem Value="586">Pakistan</asp:ListItem>
<asp:ListItem Value="585">Palau</asp:ListItem>
<asp:ListItem Value="275">Palestinian Territory, Occupied</asp:ListItem>
<asp:ListItem Value="591">Panama</asp:ListItem>
<asp:ListItem Value="598">Papua New Guinea</asp:ListItem>
<asp:ListItem Value="600">Paraguay</asp:ListItem>
<asp:ListItem Value="604">Peru</asp:ListItem>
<asp:ListItem Value="608">Philippines</asp:ListItem>
<asp:ListItem Value="612">Pitcairn</asp:ListItem>
<asp:ListItem Value="616">Poland</asp:ListItem>
<asp:ListItem Value="620">Portugal</asp:ListItem>
<asp:ListItem Value="630">Puerto Rico</asp:ListItem>
<asp:ListItem Value="634">Qatar</asp:ListItem>
<asp:ListItem Value="638">Réunion</asp:ListItem>
<asp:ListItem Value="642">Romania</asp:ListItem>
<asp:ListItem Value="643">Russian Federation</asp:ListItem>
<asp:ListItem Value="646">Rwanda</asp:ListItem>
<asp:ListItem Value="652">Saint Barthélemy</asp:ListItem>
<asp:ListItem Value="654">Saint Helena, Ascension and Tristan da Cunha</asp:ListItem>
<asp:ListItem Value="659">Saint Kitts and Nevis</asp:ListItem>
<asp:ListItem Value="662">Saint Lucia</asp:ListItem>
<asp:ListItem Value="663">Saint Martin (French part)</asp:ListItem>
<asp:ListItem Value="666">Saint Pierre and Miquelon</asp:ListItem>
<asp:ListItem Value="670">Saint Vincent and the Grenadines</asp:ListItem>
<asp:ListItem Value="882">Samoa</asp:ListItem>
<asp:ListItem Value="674">San Marino</asp:ListItem>
<asp:ListItem Value="678">Sao Tome and Principe</asp:ListItem>
<asp:ListItem Value="682">Saudi Arabia</asp:ListItem>
<asp:ListItem Value="686">Senegal</asp:ListItem>
<asp:ListItem Value="688">Serbia</asp:ListItem>
<asp:ListItem Value="690">Seychelles</asp:ListItem>
<asp:ListItem Value="694">Sierra Leone</asp:ListItem>
<asp:ListItem Value="702">Singapore</asp:ListItem>
<asp:ListItem Value="534">Sint Maarten (Dutch part)</asp:ListItem>
<asp:ListItem Value="703">Slovakia</asp:ListItem>
<asp:ListItem Value="705">Slovenia</asp:ListItem>
<asp:ListItem Value="90">Solomon Islands</asp:ListItem>
<asp:ListItem Value="706">Somalia</asp:ListItem>
<asp:ListItem Value="710">South Africa</asp:ListItem>
<asp:ListItem Value="239">South Georgia and the South Sandwich Islands</asp:ListItem>
<asp:ListItem Value="728">South Sudan</asp:ListItem>
<asp:ListItem Value="724">Spain</asp:ListItem>
<asp:ListItem Value="144">Sri Lanka</asp:ListItem>
<asp:ListItem Value="729">Sudan</asp:ListItem>
<asp:ListItem Value="740">Suriname</asp:ListItem>
<asp:ListItem Value="744">Svalbard and Jan Mayen</asp:ListItem>
<asp:ListItem Value="748">Swaziland</asp:ListItem>
<asp:ListItem Value="752">Sweden</asp:ListItem>
<asp:ListItem Value="756">Switzerland</asp:ListItem>
<asp:ListItem Value="760">Syrian Arab Republic</asp:ListItem>
<asp:ListItem Value="158">Taiwan, Province of China</asp:ListItem>
<asp:ListItem Value="762">Tajikistan</asp:ListItem>
<asp:ListItem Value="834">Tanzania, United Republic of</asp:ListItem>
<asp:ListItem Value="764">Thailand</asp:ListItem>
<asp:ListItem Value="626">Timor-Leste</asp:ListItem>
<asp:ListItem Value="768">Togo</asp:ListItem>
<asp:ListItem Value="772">Tokelau</asp:ListItem>
<asp:ListItem Value="776">Tonga</asp:ListItem>
<asp:ListItem Value="780">Trinidad and Tobago</asp:ListItem>
<asp:ListItem Value="788">Tunisia</asp:ListItem>
<asp:ListItem Value="792">Turkey</asp:ListItem>
<asp:ListItem Value="795">Turkmenistan</asp:ListItem>
<asp:ListItem Value="796">Turks and Caicos Islands</asp:ListItem>
<asp:ListItem Value="798">Tuvalu</asp:ListItem>
<asp:ListItem Value="800">Uganda</asp:ListItem>
<asp:ListItem Value="804">Ukraine</asp:ListItem>
<asp:ListItem Value="784">United Arab Emirates</asp:ListItem>
<asp:ListItem Value="826">United Kingdom</asp:ListItem>
<asp:ListItem Value="840">United States</asp:ListItem>
<asp:ListItem Value="581">United States Minor Outlying Islands</asp:ListItem>
<asp:ListItem Value="858">Uruguay</asp:ListItem>
<asp:ListItem Value="860">Uzbekistan</asp:ListItem>
<asp:ListItem Value="548">Vanuatu</asp:ListItem>
<asp:ListItem Value="862">Venezuela, Bolivarian Republic of</asp:ListItem>
<asp:ListItem Value="704">Viet Nam</asp:ListItem>
<asp:ListItem Value="92">Virgin Islands, British</asp:ListItem>
<asp:ListItem Value="850">Virgin Islands, U.S.</asp:ListItem>
<asp:ListItem Value="876">Wallis and Futuna</asp:ListItem>
<asp:ListItem Value="732">Western Sahara</asp:ListItem>
<asp:ListItem Value="887">Yemen</asp:ListItem>
<asp:ListItem Value="894">Zambia</asp:ListItem>
<asp:ListItem Value="716">Zimbabwe</asp:ListItem>
[/code]

This weekend I was working on a new website template and wanted to make to have the general settings for the site stored in the web.config file. This gave me some challenges, but as usual I found a solution for it. ASP.NET provides a configuration system we can use to keep our applications flexible at runtime.

The <appSettings> element of a web.config file is a place to store connection strings, server names, file paths, and other website settings needed by an application to perform work. I want to use the same template for different websites, so I wanted a place where I can store all the website specific information and have them changeable from a web interface.

Some of the settings that I wanted in the appSettings are:

  • Google Analytic code
  • Adsense Code
  • Google Webmaster verify code
  • Domain name
  • Recaptcha Private and Public code to use for comment

I had added them first to my web.config file, however I couldn’t get it to work to save the changes to the file. So I created a second config file called settings.config and pointed in the web.config in tha appSetting element to that config file:

[code language=”vb”]

<appSettings configSource="settings.config" />

[/code]

In the settings.config file I added all the appSettings like this:

[code language=”vb”]

<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
<add key="domain" value="diabetestype12.info" />
<add key="keyword" value="Diabetes Type 1 and 2" />
<add key="header" value="[meta name=’verify-v1′ content=’uZh/yCSVBvYTVP0dg0nYhaSAZBAPqNHQokswmg19CHs=’ /]|[meta name=’revisit’ content=’7 days’ /]" />
<add key="googleanalytics" value="UA-3718430-11" />
<add key="recaptchaPrivate" value="xxxQYAAAAAAFvUdhItSzUBfNzxxxxxx" />
<add key="recaptchaPublic" value="xxxYAAAAAACgd_3XrDokJsUFNAxxxxxxxy" /
</appSettings>

[/code]

To be able to save the information for the google webmaster verification code to the header <meta name=”verify-v1″ content=”uZh/yCSVBvYTVP0dg0nYhaSAZBAPqNHQokswmg19CHs=” />, I had to strip: <> and the vbCrLf (line return) to different characters that would be fine in the settings.config file. I change the < to [ and the > to ] and the vbCrLf to |. Here is the code I use to do that:

[code language=”vb”]

Function clean(ByVal str As String) As String
str = str.Replace("<", "[")
str = str.Replace(">", "]")
str = str.Replace(vbCrLf, "|")
str = str.Replace("""", "’")
Return str
End Function

[/code]

And the follow code to put the characters back in again:

[code language=”vb”]

Function ReFormat(ByVal str As String) As String
str = str.Replace("[", "<")
str = str.Replace("]", ">")
str = str.Replace("|", vbCrLf)
str = str.Replace("’", """")
Return str
End Function

[/code]

Make sure you add all the appSettings first in the settings.config file, as I have not made an error checking to see if the appSettings element are there. You could of course expand on that.

[code language=”vb”]

Imports System.Web.Configuration

Partial Class admin_wpexample
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Dim config As Configuration = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath)
Me.TBDomain.Text = config.AppSettings.Settings.Item("domain").Value
Me.TBkeyword.Text = config.AppSettings.Settings.Item("keyword").Value
Me.TBHeader.Text = ReFormat(config.AppSettings.Settings.Item("header").Value)
End If
End Sub

End Class

[/code]

When you click the button save settings the following code will save the information to the settings.config file:

[code language=”vb”]

Protected Sub BtnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnSave.Click
Dim config As Configuration = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath)
config.AppSettings.Settings.Remove("domain")
config.AppSettings.Settings.Add(New KeyValueConfigurationElement("domain", Me.TBDomain.Text))
config.AppSettings.Settings.Remove("keyword")
config.AppSettings.Settings.Remove("header")
config.AppSettings.Settings.Add(New KeyValueConfigurationElement("header", clean(Me.TBHeader.Text)))
config.Save()
End Sub

[/code]

The webpage looks like this:

[code language=”vb”]

<%@ Page Language="VB" MasterPageFile="~/MasterPageAdmin.master" validateRequest="false" AutoEventWireup="false" CodeFile="settings.aspx.vb" Inherits="admin_settings" title="Manage Settings" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table style="width:100%;">
<tr>
<td>
Domain Url:</td>
<td>
<asp:TextBox ID="TBDomain" runat="server" Width="287px"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Title (keywords)</td>
<td>
<asp:TextBox ID="TBkeyword" runat="server" Width="287px"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Header Meta</td>
<td>
<asp:TextBox ID="TBHeader" runat="server" Width="579px" Height="60px"
TextMode="MultiLine"></asp:TextBox>
</td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
<asp:Button ID="BtnSave" runat="server" Text="Save Settings" />
</td>
</tr>
</table>
<br />
</asp:Content>
[/code]

In order to be able to use in your text boxes “<” and not to get:

A potentially dangerous Request.Form value was detected from the client (ctl00$ContentPlaceHolder1$TBHeader=”<meta name=”verify-v…”).

You add validateRequest=”false” to the <%@ Page Language=”VB” …  %> line this will allow you to use those characters.

Now to use the stored appSettings: here an example how to add the stored meta tags to the header programmatically:

In the aspx Master page, where I want to set the Google Analytics code and the Google Webmaster Verification code programmatically I can now read from the web.config file the appSettings:

[code language=”vb”]

<%@ Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Title</title>

<asp:ContentPlaceHolder ID="head" runat="server">
<asp:Literal ID="ltlheader" runat="server"></asp:Literal>
</asp:ContentPlaceHolder>
</head>

<body>
<form id="form1" runat="server">

<asp:Literal ID="LtlAnalytics" runat="server"></asp:Literal>
</form>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src=’" + gaJsHost + "google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker(MyAnalytics);
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>

[/code]

In the code behind it looks like this:

[code language=”vb”]

Me.LtlAnalytics.Text = "<script type=""text/javascript"">var MyAnalytics=""" & System.Configuration.ConfigurationManager.AppSettings("GoogleAnalytics").ToString & """;</script>"

Me.ltlheader.Text = ReFormat(System.Configuration.ConfigurationManager.AppSettings("header").ToString)

[/code]

The same way you can have your Adsense code stored in the web.config file and you will be able to change the code for the adsense without having to go to the page to change it. You can have a literal on your page that you fill with the Adsense code or you do a replace text, if you read the text from database and want to insert the Adsense code. Just use a custom tage like #Adsense1#

[code language=”vb”]

Dim Adwords1 As String = ReFormat(System.Configuration.ConfigurationManager.AppSettings("Adwords1").ToString)
Me.LTLRelated.Text = Me.LTLRelated.Text.Replace("#Adwords1#", Adwords1)
[/code]

Have fun programming :)

Here is some code that I have been using to save my images into a MS Access Database with ASPX vb.net.

The html code looks like this. It is to upload a picture and add title and description to it.
[code language=”vb”]
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h1>
Image Upload Information</h1>
<p style="text-align: left">

<table>
<tr>
<td style="width: 100px">
&amp;nbsp; Image :&amp;nbsp;</td>
<td style="width: 100px">
<asp:FileUpload ID="FileUpload1" runat="server" /></td>
</tr>
<tr>
<td style="width: 100px">
&amp;nbsp; Title &amp;nbsp;&amp;nbsp; :&amp;nbsp;</td>
<td style="width: 100px">
<asp:TextBox ID="Tbtitle" runat="server" Width="376px">Title Here</asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px">
&amp;nbsp; Description :&amp;nbsp;</td>
<td style="width: 100px">
<asp:TextBox ID="description" runat="server" Height="88px" TextMode="MultiLine" Width="384px">Description Here</asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px">
&amp;nbsp;Location :&amp;nbsp;</td>
<td style="width: 100px">
<asp:TextBox ID="location" runat="server" Width="376px">Location Here</asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px">
&amp;nbsp; Tags :&amp;nbsp;</td>
<td style="width: 100px">
<asp:TextBox ID="tags" runat="server" Width="376px">Tags Here</asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px">
&amp;nbsp;Width :&amp;nbsp;<br />
</td>
<td style="width: 100px">
<asp:TextBox ID="width" runat="server" Width="40px">1024</asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px">
&amp;nbsp;&amp;nbsp; Height :&amp;nbsp;</td>
<td style="width: 100px">
<asp:TextBox ID="height" runat="server" Width="40px">768</asp:TextBox></td>
</tr>
<tr>
<td style="width: 100px">
</td>
<td style="width: 100px">
</td>
</tr>
<tr>
<td style="width: 100px">
</td>
<td style="width: 100px">
<asp:Button ID="Button1" runat="server" Text="Upload Image" /></td>
</tr>
</table>
<br />
&amp;nbsp;
<br />
<br />
<asp:Literal ID="Literal1" runat="server"></asp:Literal>
</p>
</asp:Content>
[/code]
In the code behind page the following code is there. When you click the button it will upload the image to the MS Access Database and it will show the image on the page in the literal1

[code lang=”vb”]
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim wService As com.www.imgStore = New com.www.imgStore
Dim myFile As HttpPostedFile = FileUpload1.PostedFile
Dim nFileLen As Integer = myFile.ContentLength
Dim myData(nFileLen) As Byte
myFile.InputStream.Read(myData, 0, nFileLen)
Dim ms As IO.MemoryStream = New IO.MemoryStream(myData)
Dim img As Drawing.Image = convertImg(ms)
img = resizeImage(img, width.Text.Trim &amp; "x" &amp; height.Text.Trim)
Dim bytes() As Byte = imgToBytes(img)
Dim ret As String = wService.storeImage(Tbtitle.Text, description.Text, location.Text, tags.Text, width.Text, height.Text, Date.Now, bytes)
Literal1.Text = "http://www.yoursite.com/imgGrabing.aspx?id=" &amp; ret &amp; "<br/>" &amp; bytes.Length &amp; " Bytes Uploaded<br/><img src=""imgGrabing.aspx?id=" &amp; ret &amp; """>"
wService.Dispose()
ms.Dispose()
img.Dispose()
End Sub
[/code]

This is the code to convert the image.
[code language=”vb”]
Public Function convertImg(ByVal imgL As IO.MemoryStream) As System.Drawing.Image
Dim memstream As IO.MemoryStream = New IO.MemoryStream
Dim icf() As Drawing.Imaging.ImageCodecInfo = Drawing.Imaging.ImageCodecInfo.GetImageEncoders
Dim encps As Drawing.Imaging.EncoderParameters = New Drawing.Imaging.EncoderParameters(1)
encps.Param(0) = New Drawing.Imaging.EncoderParameter(Drawing.Imaging.Encoder.Quality, 100)
Dim btmp As Drawing.Bitmap = Drawing.Bitmap.FromStream(imgL)
btmp.Save(memstream, icf(1), encps)
btmp.Dispose()
btmp = Nothing
Dim img As Drawing.Image = Drawing.Bitmap.FromStream(memstream)
Return img
End Function
[/code]

Move the image over into a Byte() is done here:
[code language=”vb”]
Public Function imgToBytes(ByVal bmp As Drawing.Image) As Byte()
Dim ms As New IO.MemoryStream
bmp.Save(ms, Drawing.Imaging.ImageFormat.Jpeg)
Dim abyt(ms.Length – 1) As Byte
ms.Seek(0, IO.SeekOrigin.Begin)
ms.Read(abyt, 0, ms.Length)
Return abyt
End Function
[/code]

When I save the image, I resize it to a decent size to store in the database, so that I dont have to worry about resizing the images first before uploading.
[code language=”vb”]
Public Function resizeImage(ByVal img As Drawing.Image, ByVal size As String) As Drawing.Image
Dim oImg As Drawing.Image = img
Dim width As Integer = size.Split("x")(0)
Dim height As Integer = size.Split("x")(1)
Dim oThumbNail As Drawing.Image = New Drawing.Bitmap(width, height, oImg.PixelFormat)
Dim oGraphic As Drawing.Graphics = Drawing.Graphics.FromImage(oThumbNail)
oGraphic.CompositingQuality = Drawing.Drawing2D.CompositingQuality.HighQuality
oGraphic.SmoothingMode = Drawing.Drawing2D.SmoothingMode.HighQuality
oGraphic.InterpolationMode = Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
Dim oRectangle As Drawing.Rectangle = New Drawing.Rectangle(0, 0, oThumbNail.Width, oThumbNail.Height)
oGraphic.DrawImage(oImg, oRectangle)
oImg.Dispose()
Return oThumbNail
End Function
[/code]

I have created a webservice to save the images, because I use it also to upload still images from my PTZ camera and it just connects to the webservice and stores the images.
[code language=”vb”]
<WebMethod()> _
Public Function storeImage(ByVal cameraid As Integer, ByVal preset As Integer, ByVal bits() As Byte) As Boolean
saveImg(cameraid, preset, Date.Now, bits)
Return True
End Function

Public Function saveImg(ByVal Cameraid As Integer, ByVal preset As Integer, ByVal picTimeStamp As Date, ByVal picImg As Byte()) As Boolean
Try
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\database.mdb"
Dim oleDBConn As New Data.OleDb.OleDbConnection(strConn)
oleDBConn.Open()
Dim oleDBAdapter As Data.OleDb.OleDbDataAdapter = New Data.OleDb.OleDbDataAdapter("Select * From Pictures", strConn)
Dim oleDBcb As Data.OleDb.OleDbCommandBuilder = New Data.OleDb.OleDbCommandBuilder(oleDBAdapter)
Dim ds As Data.DataSet = New Data.DataSet
oleDBAdapter.MissingSchemaAction = Data.MissingSchemaAction.AddWithKey
oleDBAdapter.Fill(ds, "Pictures")
Dim dsRow As Data.DataRow = ds.Tables(0).NewRow
dsRow.BeginEdit()
dsRow("Cameraid") = Cameraid
dsRow("Preset") = preset
dsRow("picTimeStamp") = picTimeStamp
dsRow("picBinary") = picImg
dsRow.EndEdit()
ds.Tables(0).Rows.Add(dsRow)
oleDBAdapter.Update(ds.Tables(0))
ds.AcceptChanges()
oleDBConn.Dispose()
oleDBcb.Dispose()
oleDBAdapter.Dispose()
Return True
Catch ex As Exception
Return False
End Try
End Function
[/code]

The Access Database structure I used is:
ImgID:AutoNumber
PicTimeStamp: Date/Time
picBinary:Ole Object
CameraID:Number
Preset:Number

Hope this will get you going in the right direction and start to save your Images to Database using vb.net and MS Access

One of the things I often do with my website is populate a Dropdownlist1 with information from a MYSQL database. Here is an example code which I use to do that:
[code language=”vb”]Dim myConnectionString As String = System.Configuration.ConfigurationManager.ConnectionStrings("myConnectionString").ConnectionString
Dim conn As MySqlConnection = New MySqlConnection(myConnectionString)
Dim cmd As MySqlCommand = New MySqlCommand(myConnectionString)
Dim sqlString As String = Nothing
Dim myConnection As New MySqlConnection(myConnectionString)
Dim myAdapter As MySqlDataAdapter = New MySqlDataAdapter(sqlString, myConnection)
Dim DS As DataSet = New DataSet

myAdapter.SelectCommand.CommandText = "select ID,MyDescription from Mydropdowntable"
myAdapter.Fill(DS)
Dim RText As String = "[Please Select]"
Me.Dropdownlist1.Items.Clear()
If DS.Tables(0).Rows.Count > 0 Then
For i As Integer = 0 To DS.Tables(0).Rows.Count – 1
Me.Dropdownlist1.Items.Insert(0, New ListItem(DS.Tables(0).Rows(i).Item(0).ToString, DS.Tables(0).Rows(i).Item(0).ToString))
Next
Else
RText = "Nothing Available"
End If
Me.Dropdownlist1.Items.Insert(0, New ListItem(RText, "0"))

myAdapter.Dispose()
myConnection.Dispose()
DS.Dispose()[/code].
I am connecting to a MYSQL database and are using Devart .Net Database connection with VS2008

You have to import the following at the beginning:
[code language=”vb”]Imports System.Data
Imports CoreLab.MySql[/code].

Today I got again an email warning people of a person having AIDS. In total I got three messages, two different persons. In both cases the person, who was infected was female.

In my opinion is is completely wrong to forward these messages! Yes, of course you want to warn someone about a potential risk, however if you don’t know the person, I think you shouldn’t forward it! Let me explain. If hher boy friend who got over jealous reacted with sending out this email, what devasting effect that will have on this persons life? You ever thought about that? I don’t believe most people don’t even think about it and just forward these emails. With the power of the internet this spreads like wild fire. And in this case the same email reached my twice within a week!

Of course I agree if these persons are really willingly infectiong people with AIDS, I would agree a warning would be nice. However how come that we only warning people agains infected AIDS persons and not against known criminals or killers in our society, via email? In most cases the identities of these persons, when published are not revealed and if there is a picture the eyes are covered with a black bar or so.  That makes me really wonder… if there is a jealous lover at play, who wants to make sure to hurt this persons as much as possible.

See if people would be more concerned about their own health and start protecting themselves by having protected sex, you would reduce the risk of getting infected. And if you are really concerned, dont have sex at all, unless you really establish a relationship and get to know your partner better than the night. However  most people feel by spreading these emails some kind of “protection”, because a person with AIDS got a face. However at the same time the forget that at the same time to go to bed with the person they met a hour ago, can have AIDS as well…

I hope that people realize more what their actions of just a simple forwarded email can do to someone, you never met and dont know the complete story. Just think for a moment, because the internet is a very powerful viral medium, just because someone else emailed you the email it must be right, is so wrong! There are more emails hoaxes running around the internet than real stories.

SEO Powered by Platinum SEO from Techblissonline