Wanna Current Currency Rate In Your Website ?? Again, Webservice is Here…

Dear friends,

Do you want current currency rate embeded in your webpage, Here is the tutorial…

Here i m using webservice again…

open this link http://www.webservicex.net/ws/WSDetails.aspx?CATID=2&WSID=10

Now, before using it, be assure whether it’s running properly or not,

scroll down and click the  function ConversionRate

a1

Now Put parameters and click Invoke button

a2

Finnaly you will get Current rate in new window , like below

a3

Fine, it’s working

Well, Now let’s embed this into a webpage…

First of all add the reference of this webservice into your website…

1. create a new website

2. open Solution explorer , select your website and right click and select the option Add Web Reference

3. Now following window will be opened , put http://www.webservicex.net/CurrencyConvertor.asmx?WSDL in URL area and chnage Web reference name (optional) and click Add Reference Button (circled in image)

a5

5. Now put the following code in .aspx file

<%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”~/CurrencyConvertor.aspx.cs” Inherits=”_CurrencyConvertor” %><!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;<html xmlns=”http://www.w3.org/1999/xhtml”&gt;
<head runat=”server”>
<title></title>
</head>
<body>
<form id=”form1″ runat=”server”>
<div>
Enter Amount&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<asp:TextBox ID=”txtAmt” runat=”server” Width=”205px”></asp:TextBox>
<br />
<br />
<br />
From
<asp:DropDownList ID=”drpFrom” runat=”server”>
<asp:ListItem Value=”AFA”>Afghanistan Afghani</asp:ListItem>
<asp:ListItem Value=”AUD”>Australian Dollar</asp:ListItem>
<asp:ListItem Value=”AFA”>Afghanistan Afghani</asp:ListItem>
<asp:ListItem Value=”ALL”>Albanian Lek</asp:ListItem>
<asp:ListItem Value=”DZD”>Algerian Dinar</asp:ListItem>
<asp:ListItem Value=”ARS”>Argentine Peso</asp:ListItem>
<asp:ListItem Value=”AWG”>Aruba Florin</asp:ListItem>
<asp:ListItem Value=”AUD”>Australian Dollar</asp:ListItem>
<asp:ListItem Value=”BSD”>Bahamian Dollar</asp:ListItem>
<asp:ListItem Value=”BHD”>Bahraini Dinar</asp:ListItem>
<asp:ListItem Value=”BDT”>Bangladesh Taka</asp:ListItem>
<asp:ListItem Value=”BBD”>Barbados Dollar</asp:ListItem>
<asp:ListItem Value=”BZD”>Belize Dollar</asp:ListItem>
<asp:ListItem Value=”BMD”>Bermuda Dollar</asp:ListItem>
<asp:ListItem Value=”BTN”>Bhutan Ngultrum</asp:ListItem>
<asp:ListItem Value=”BOB”>Bolivian Boliviano</asp:ListItem>
<asp:ListItem Value=”BWP”>Botswana Pula</asp:ListItem>
<asp:ListItem Value=”BRL”>Brazilian Real</asp:ListItem>
<asp:ListItem Value=”GBP”>British Pound</asp:ListItem>
<asp:ListItem Value=”BND”>Brunei Dollar</asp:ListItem>
<asp:ListItem Value=”BIF”>Burundi Franc</asp:ListItem>
<asp:ListItem Value=”XOF”>CFA Franc (BCEAO)</asp:ListItem>
<asp:ListItem Value=”XAF”>CFA Franc (BEAC)</asp:ListItem>
<asp:ListItem Value=”KHR”>Cambodia Riel</asp:ListItem>
<asp:ListItem Value=”CAD”>Canadian Dollar</asp:ListItem>
<asp:ListItem Value=”CVE”>Cape Verde Escudo</asp:ListItem>
<asp:ListItem Value=”KYD”>Cayman Islands Dollar</asp:ListItem>
<asp:ListItem Value=”CLP”>Chilean Peso</asp:ListItem>
<asp:ListItem Value=”CNY”>Chinese Yuan</asp:ListItem>
<asp:ListItem Value=”COP”>Colombian Peso</asp:ListItem>
<asp:ListItem Value=”KMF”>Comoros Franc</asp:ListItem>
<asp:ListItem Value=”CRC”>Costa Rica Colon</asp:ListItem>
<asp:ListItem Value=”HRK”>Croatian Kuna</asp:ListItem>
<asp:ListItem Value=”CUP”>Cuban Peso</asp:ListItem>
<asp:ListItem Value=”CYP”>Cyprus Pound</asp:ListItem>
<asp:ListItem Value=”CZK”>Czech Koruna</asp:ListItem>
<asp:ListItem Value=”DKK”>Danish Krone</asp:ListItem>
<asp:ListItem Value=”DJF”>Dijibouti Franc</asp:ListItem>
<asp:ListItem Value=”DOP”>Dominican Peso</asp:ListItem>
<asp:ListItem Value=”XCD”>East Caribbean Dollar</asp:ListItem>
<asp:ListItem Value=”EGP”>Egyptian Pound</asp:ListItem>
<asp:ListItem Value=”SVC”>El Salvador Colon</asp:ListItem>
<asp:ListItem Value=”EEK”>Estonian Kroon</asp:ListItem>
<asp:ListItem Value=”ETB”>Ethiopian Birr</asp:ListItem>
<asp:ListItem Value=”EUR”>Euro</asp:ListItem>
<asp:ListItem Value=”FKP”>Falkland Islands Pound</asp:ListItem>
<asp:ListItem Value=”GMD”>Gambian Dalasi</asp:ListItem>
<asp:ListItem Value=”GHC”>Ghanian Cedi</asp:ListItem>
<asp:ListItem Value=”GIP”>Gibraltar Pound</asp:ListItem>
<asp:ListItem Value=”XAU”>Gold Ounces</asp:ListItem>
<asp:ListItem Value=”GTQ”>Guatemala Quetzal</asp:ListItem>
<asp:ListItem Value=”GNF”>Guinea Franc</asp:ListItem>
<asp:ListItem Value=”GYD”>Guyana Dollar</asp:ListItem>
<asp:ListItem Value=”HTG”>Haiti Gourde</asp:ListItem>
<asp:ListItem Value=”HNL”>Honduras Lempira</asp:ListItem>
<asp:ListItem Value=”HKD”>Hong Kong Dollar</asp:ListItem>
<asp:ListItem Value=”HUF”>Hungarian Forint</asp:ListItem>
<asp:ListItem Value=”ISK”>Iceland Krona</asp:ListItem>
<asp:ListItem Value=”INR”>Indian Rupee</asp:ListItem>
<asp:ListItem Value=”IDR”>Indonesian Rupiah</asp:ListItem>
<asp:ListItem Value=”IQD”>Iraqi Dinar</asp:ListItem>
<asp:ListItem Value=”ILS”>Israeli Shekel</asp:ListItem>
<asp:ListItem Value=”JMD”>Jamaican Dollar</asp:ListItem>
<asp:ListItem Value=”JPY”>Japanese Yen</asp:ListItem>
<asp:ListItem Value=”JOD”>Jordanian Dinar</asp:ListItem>
<asp:ListItem Value=”KZT”>Kazakhstan Tenge</asp:ListItem>
<asp:ListItem Value=”KES”>Kenyan Shilling</asp:ListItem>
<asp:ListItem Value=”KRW”>Korean Won</asp:ListItem>
<asp:ListItem Value=”KWD”>Kuwaiti Dinar</asp:ListItem>
<asp:ListItem Value=”LAK”>Lao Kip</asp:ListItem>
<asp:ListItem Value=”LVL”>Latvian Lat</asp:ListItem>
<asp:ListItem Value=”LBP”>Lebanese Pound</asp:ListItem>
<asp:ListItem Value=”LSL”>Lesotho Loti</asp:ListItem>
<asp:ListItem Value=”LRD”>Liberian Dollar</asp:ListItem>
<asp:ListItem Value=”LYD”>Libyan Dinar</asp:ListItem>
<asp:ListItem Value=”LTL”>Lithuanian Lita</asp:ListItem>
<asp:ListItem Value=”MOP”>Macau Pataca</asp:ListItem>
<asp:ListItem Value=”MKD”>Macedonian Denar</asp:ListItem>
<asp:ListItem Value=”MGF”>Malagasy Franc</asp:ListItem>
<asp:ListItem Value=”MWK”>Malawi Kwacha</asp:ListItem>
<asp:ListItem Value=”MYR”>Malaysian Ringgit</asp:ListItem>
<asp:ListItem Value=”MVR”>Maldives Rufiyaa</asp:ListItem>
<asp:ListItem Value=”MTL”>Maltese Lira</asp:ListItem>
<asp:ListItem Value=”MRO”>Mauritania Ougulya</asp:ListItem>
<asp:ListItem Value=”MUR”>Mauritius Rupee</asp:ListItem>
<asp:ListItem Value=”MXN”>Mexican Peso</asp:ListItem>
<asp:ListItem Value=”MDL”>Moldovan Leu</asp:ListItem>
<asp:ListItem Value=”MNT”>Mongolian Tugrik</asp:ListItem>
<asp:ListItem Value=”MAD”>Moroccan Dirham</asp:ListItem>
<asp:ListItem Value=”MZM”>Mozambique Metical</asp:ListItem>
<asp:ListItem Value=”MMK”>Myanmar Kyat</asp:ListItem>
<asp:ListItem Value=”NAD”>Namibian Dollar</asp:ListItem>
<asp:ListItem Value=”NPR”>Nepalese Rupee</asp:ListItem>
<asp:ListItem Value=”ANG”>Neth Antilles Guilder</asp:ListItem>
<asp:ListItem Value=”NZD”>New Zealand Dollar</asp:ListItem>
<asp:ListItem Value=”NIO”>Nicaragua Cordoba</asp:ListItem>
<asp:ListItem Value=”NGN”>Nigerian Naira</asp:ListItem>
<asp:ListItem Value=”KPW”>North Korean Won</asp:ListItem>
<asp:ListItem Value=”NOK”>Norwegian Krone</asp:ListItem>
<asp:ListItem Value=”OMR”>Omani Rial</asp:ListItem>
<asp:ListItem Value=”XPF”>Pacific Franc</asp:ListItem>
<asp:ListItem Value=”PKR”>Pakistani Rupee</asp:ListItem>
<asp:ListItem Value=”XPD”>Palladium Ounces</asp:ListItem>
<asp:ListItem Value=”PAB”>Panama Balboa</asp:ListItem>
<asp:ListItem Value=”PGK”>Papua New Guinea Kina</asp:ListItem>
<asp:ListItem Value=”PYG”>Paraguayan Guarani</asp:ListItem>
<asp:ListItem Value=”PEN”>Peruvian Nuevo Sol</asp:ListItem>
<asp:ListItem Value=”PHP”>Philippine Peso</asp:ListItem>
<asp:ListItem Value=”XPT”>Platinum Ounces</asp:ListItem>
<asp:ListItem Value=”PLN”>Polish Zloty</asp:ListItem>
<asp:ListItem Value=”QAR”>Qatar Rial</asp:ListItem>
<asp:ListItem Value=”ROL”>Romanian Leu</asp:ListItem>
<asp:ListItem Value=”RUB”>Russian Rouble</asp:ListItem>
<asp:ListItem Value=”WST”>Samoa Tala</asp:ListItem>
<asp:ListItem Value=”STD”>Sao Tome Dobra</asp:ListItem>
<asp:ListItem Value=”SAR”>Saudi Arabian Riyal</asp:ListItem>
<asp:ListItem Value=”SCR”>Seychelles Rupee</asp:ListItem>
<asp:ListItem Value=”SLL”>Sierra Leone Leone</asp:ListItem>
<asp:ListItem Value=”XAG”>Silver Ounces</asp:ListItem>
<asp:ListItem Value=”SGD”>Singapore Dollar</asp:ListItem>
<asp:ListItem Value=”SKK”>Slovak Koruna</asp:ListItem>
<asp:ListItem Value=”SIT”>Slovenian Tolar</asp:ListItem>
<asp:ListItem Value=”SBD”>Solomon Islands Dollar</asp:ListItem>
<asp:ListItem Value=”SOS”>Somali Shilling</asp:ListItem>
<asp:ListItem Value=”ZAR”>South African Rand</asp:ListItem>
<asp:ListItem Value=”LKR”>Sri Lanka Rupee</asp:ListItem>
<asp:ListItem Value=”SHP”>St Helena Pound</asp:ListItem>
<asp:ListItem Value=”SDD”>Sudanese Dinar</asp:ListItem>
<asp:ListItem Value=”SRG”>Surinam Guilder</asp:ListItem>
<asp:ListItem Value=”SZL”>Swaziland Lilageni</asp:ListItem>
<asp:ListItem Value=”SEK”>Swedish Krona</asp:ListItem>
<asp:ListItem Value=”TRY”>Turkey Lira</asp:ListItem>
<asp:ListItem Value=”CHF”>Swiss Franc</asp:ListItem>
<asp:ListItem Value=”SYP”>Syrian Pound</asp:ListItem>
<asp:ListItem Value=”TWD”>Taiwan Dollar</asp:ListItem>
<asp:ListItem Value=”TZS”>Tanzanian Shilling</asp:ListItem>
<asp:ListItem Value=”THB”>Thai Baht</asp:ListItem>
<asp:ListItem Value=”TOP”>Tonga Pa’anga</asp:ListItem>
<asp:ListItem Value=”TTD”>Trinidad&amp;Tobago Dollar</asp:ListItem>
<asp:ListItem Value=”TND”>Tunisian Dinar</asp:ListItem>
<asp:ListItem Value=”TRL”>Turkish Lira</asp:ListItem>
<asp:ListItem Value=”USD”>U.S. Dollar</asp:ListItem>
<asp:ListItem Value=”AED”>UAE Dirham</asp:ListItem>
<asp:ListItem Value=”UGX”>Ugandan Shilling</asp:ListItem>
<asp:ListItem Value=”UAH”>Ukraine Hryvnia</asp:ListItem>
<asp:ListItem Value=”UYU”>Uruguayan New Peso</asp:ListItem>
<asp:ListItem Value=”VUV”>Vanuatu Vatu</asp:ListItem>
<asp:ListItem Value=”VEB”>Venezuelan Bolivar</asp:ListItem>
<asp:ListItem Value=”VND”>Vietnam Dong</asp:ListItem>
<asp:ListItem Value=”YER”>Yemen Riyal</asp:ListItem>
<asp:ListItem Value=”YUM”>Yugoslav Dinar</asp:ListItem>
<asp:ListItem Value=”ZMK”>Zambian Kwacha</asp:ListItem>
<asp:ListItem Value=”ZWD”>Zimbabwe Dollar</asp:ListItem></asp:DropDownList>
&nbsp;&nbsp;&nbsp;
To&nbsp;&nbsp;&nbsp;
<asp:DropDownList ID=”drpTo” runat=”server”><asp:ListItem Value=”AFA”>Afghanistan Afghani</asp:ListItem>
<asp:ListItem Value=”AUD”>Australian Dollar</asp:ListItem>
<asp:ListItem Value=”AFA”>Afghanistan Afghani</asp:ListItem>
<asp:ListItem Value=”ALL”>Albanian Lek</asp:ListItem>
<asp:ListItem Value=”DZD”>Algerian Dinar</asp:ListItem>
<asp:ListItem Value=”ARS”>Argentine Peso</asp:ListItem>
<asp:ListItem Value=”AWG”>Aruba Florin</asp:ListItem>
<asp:ListItem Value=”AUD”>Australian Dollar</asp:ListItem>
<asp:ListItem Value=”BSD”>Bahamian Dollar</asp:ListItem>
<asp:ListItem Value=”BHD”>Bahraini Dinar</asp:ListItem>
<asp:ListItem Value=”BDT”>Bangladesh Taka</asp:ListItem>
<asp:ListItem Value=”BBD”>Barbados Dollar</asp:ListItem>
<asp:ListItem Value=”BZD”>Belize Dollar</asp:ListItem>
<asp:ListItem Value=”BMD”>Bermuda Dollar</asp:ListItem>
<asp:ListItem Value=”BTN”>Bhutan Ngultrum</asp:ListItem>
<asp:ListItem Value=”BOB”>Bolivian Boliviano</asp:ListItem>
<asp:ListItem Value=”BWP”>Botswana Pula</asp:ListItem>
<asp:ListItem Value=”BRL”>Brazilian Real</asp:ListItem>
<asp:ListItem Value=”GBP”>British Pound</asp:ListItem>
<asp:ListItem Value=”BND”>Brunei Dollar</asp:ListItem>
<asp:ListItem Value=”BIF”>Burundi Franc</asp:ListItem>
<asp:ListItem Value=”XOF”>CFA Franc (BCEAO)</asp:ListItem>
<asp:ListItem Value=”XAF”>CFA Franc (BEAC)</asp:ListItem>
<asp:ListItem Value=”KHR”>Cambodia Riel</asp:ListItem>
<asp:ListItem Value=”CAD”>Canadian Dollar</asp:ListItem>
<asp:ListItem Value=”CVE”>Cape Verde Escudo</asp:ListItem>
<asp:ListItem Value=”KYD”>Cayman Islands Dollar</asp:ListItem>
<asp:ListItem Value=”CLP”>Chilean Peso</asp:ListItem>
<asp:ListItem Value=”CNY”>Chinese Yuan</asp:ListItem>
<asp:ListItem Value=”COP”>Colombian Peso</asp:ListItem>
<asp:ListItem Value=”KMF”>Comoros Franc</asp:ListItem>
<asp:ListItem Value=”CRC”>Costa Rica Colon</asp:ListItem>
<asp:ListItem Value=”HRK”>Croatian Kuna</asp:ListItem>
<asp:ListItem Value=”CUP”>Cuban Peso</asp:ListItem>
<asp:ListItem Value=”CYP”>Cyprus Pound</asp:ListItem>
<asp:ListItem Value=”CZK”>Czech Koruna</asp:ListItem>
<asp:ListItem Value=”DKK”>Danish Krone</asp:ListItem>
<asp:ListItem Value=”DJF”>Dijibouti Franc</asp:ListItem>
<asp:ListItem Value=”DOP”>Dominican Peso</asp:ListItem>
<asp:ListItem Value=”XCD”>East Caribbean Dollar</asp:ListItem>
<asp:ListItem Value=”EGP”>Egyptian Pound</asp:ListItem>
<asp:ListItem Value=”SVC”>El Salvador Colon</asp:ListItem>
<asp:ListItem Value=”EEK”>Estonian Kroon</asp:ListItem>
<asp:ListItem Value=”ETB”>Ethiopian Birr</asp:ListItem>
<asp:ListItem Value=”EUR”>Euro</asp:ListItem>
<asp:ListItem Value=”FKP”>Falkland Islands Pound</asp:ListItem>
<asp:ListItem Value=”GMD”>Gambian Dalasi</asp:ListItem>
<asp:ListItem Value=”GHC”>Ghanian Cedi</asp:ListItem>
<asp:ListItem Value=”GIP”>Gibraltar Pound</asp:ListItem>
<asp:ListItem Value=”XAU”>Gold Ounces</asp:ListItem>
<asp:ListItem Value=”GTQ”>Guatemala Quetzal</asp:ListItem>
<asp:ListItem Value=”GNF”>Guinea Franc</asp:ListItem>
<asp:ListItem Value=”GYD”>Guyana Dollar</asp:ListItem>
<asp:ListItem Value=”HTG”>Haiti Gourde</asp:ListItem>
<asp:ListItem Value=”HNL”>Honduras Lempira</asp:ListItem>
<asp:ListItem Value=”HKD”>Hong Kong Dollar</asp:ListItem>
<asp:ListItem Value=”HUF”>Hungarian Forint</asp:ListItem>
<asp:ListItem Value=”ISK”>Iceland Krona</asp:ListItem>
<asp:ListItem Value=”INR”>Indian Rupee</asp:ListItem>
<asp:ListItem Value=”IDR”>Indonesian Rupiah</asp:ListItem>
<asp:ListItem Value=”IQD”>Iraqi Dinar</asp:ListItem>
<asp:ListItem Value=”ILS”>Israeli Shekel</asp:ListItem>
<asp:ListItem Value=”JMD”>Jamaican Dollar</asp:ListItem>
<asp:ListItem Value=”JPY”>Japanese Yen</asp:ListItem>
<asp:ListItem Value=”JOD”>Jordanian Dinar</asp:ListItem>
<asp:ListItem Value=”KZT”>Kazakhstan Tenge</asp:ListItem>
<asp:ListItem Value=”KES”>Kenyan Shilling</asp:ListItem>
<asp:ListItem Value=”KRW”>Korean Won</asp:ListItem>
<asp:ListItem Value=”KWD”>Kuwaiti Dinar</asp:ListItem>
<asp:ListItem Value=”LAK”>Lao Kip</asp:ListItem>
<asp:ListItem Value=”LVL”>Latvian Lat</asp:ListItem>
<asp:ListItem Value=”LBP”>Lebanese Pound</asp:ListItem>
<asp:ListItem Value=”LSL”>Lesotho Loti</asp:ListItem>
<asp:ListItem Value=”LRD”>Liberian Dollar</asp:ListItem>
<asp:ListItem Value=”LYD”>Libyan Dinar</asp:ListItem>
<asp:ListItem Value=”LTL”>Lithuanian Lita</asp:ListItem>
<asp:ListItem Value=”MOP”>Macau Pataca</asp:ListItem>
<asp:ListItem Value=”MKD”>Macedonian Denar</asp:ListItem>
<asp:ListItem Value=”MGF”>Malagasy Franc</asp:ListItem>
<asp:ListItem Value=”MWK”>Malawi Kwacha</asp:ListItem>
<asp:ListItem Value=”MYR”>Malaysian Ringgit</asp:ListItem>
<asp:ListItem Value=”MVR”>Maldives Rufiyaa</asp:ListItem>
<asp:ListItem Value=”MTL”>Maltese Lira</asp:ListItem>
<asp:ListItem Value=”MRO”>Mauritania Ougulya</asp:ListItem>
<asp:ListItem Value=”MUR”>Mauritius Rupee</asp:ListItem>
<asp:ListItem Value=”MXN”>Mexican Peso</asp:ListItem>
<asp:ListItem Value=”MDL”>Moldovan Leu</asp:ListItem>
<asp:ListItem Value=”MNT”>Mongolian Tugrik</asp:ListItem>
<asp:ListItem Value=”MAD”>Moroccan Dirham</asp:ListItem>
<asp:ListItem Value=”MZM”>Mozambique Metical</asp:ListItem>
<asp:ListItem Value=”MMK”>Myanmar Kyat</asp:ListItem>
<asp:ListItem Value=”NAD”>Namibian Dollar</asp:ListItem>
<asp:ListItem Value=”NPR”>Nepalese Rupee</asp:ListItem>
<asp:ListItem Value=”ANG”>Neth Antilles Guilder</asp:ListItem>
<asp:ListItem Value=”NZD”>New Zealand Dollar</asp:ListItem>
<asp:ListItem Value=”NIO”>Nicaragua Cordoba</asp:ListItem>
<asp:ListItem Value=”NGN”>Nigerian Naira</asp:ListItem>
<asp:ListItem Value=”KPW”>North Korean Won</asp:ListItem>
<asp:ListItem Value=”NOK”>Norwegian Krone</asp:ListItem>
<asp:ListItem Value=”OMR”>Omani Rial</asp:ListItem>
<asp:ListItem Value=”XPF”>Pacific Franc</asp:ListItem>
<asp:ListItem Value=”PKR”>Pakistani Rupee</asp:ListItem>
<asp:ListItem Value=”XPD”>Palladium Ounces</asp:ListItem>
<asp:ListItem Value=”PAB”>Panama Balboa</asp:ListItem>
<asp:ListItem Value=”PGK”>Papua New Guinea Kina</asp:ListItem>
<asp:ListItem Value=”PYG”>Paraguayan Guarani</asp:ListItem>
<asp:ListItem Value=”PEN”>Peruvian Nuevo Sol</asp:ListItem>
<asp:ListItem Value=”PHP”>Philippine Peso</asp:ListItem>
<asp:ListItem Value=”XPT”>Platinum Ounces</asp:ListItem>
<asp:ListItem Value=”PLN”>Polish Zloty</asp:ListItem>
<asp:ListItem Value=”QAR”>Qatar Rial</asp:ListItem>
<asp:ListItem Value=”ROL”>Romanian Leu</asp:ListItem>
<asp:ListItem Value=”RUB”>Russian Rouble</asp:ListItem>
<asp:ListItem Value=”WST”>Samoa Tala</asp:ListItem>
<asp:ListItem Value=”STD”>Sao Tome Dobra</asp:ListItem>
<asp:ListItem Value=”SAR”>Saudi Arabian Riyal</asp:ListItem>
<asp:ListItem Value=”SCR”>Seychelles Rupee</asp:ListItem>
<asp:ListItem Value=”SLL”>Sierra Leone Leone</asp:ListItem>
<asp:ListItem Value=”XAG”>Silver Ounces</asp:ListItem>
<asp:ListItem Value=”SGD”>Singapore Dollar</asp:ListItem>
<asp:ListItem Value=”SKK”>Slovak Koruna</asp:ListItem>
<asp:ListItem Value=”SIT”>Slovenian Tolar</asp:ListItem>
<asp:ListItem Value=”SBD”>Solomon Islands Dollar</asp:ListItem>
<asp:ListItem Value=”SOS”>Somali Shilling</asp:ListItem>
<asp:ListItem Value=”ZAR”>South African Rand</asp:ListItem>
<asp:ListItem Value=”LKR”>Sri Lanka Rupee</asp:ListItem>
<asp:ListItem Value=”SHP”>St Helena Pound</asp:ListItem>
<asp:ListItem Value=”SDD”>Sudanese Dinar</asp:ListItem>
<asp:ListItem Value=”SRG”>Surinam Guilder</asp:ListItem>
<asp:ListItem Value=”SZL”>Swaziland Lilageni</asp:ListItem>
<asp:ListItem Value=”SEK”>Swedish Krona</asp:ListItem>
<asp:ListItem Value=”TRY”>Turkey Lira</asp:ListItem>
<asp:ListItem Value=”CHF”>Swiss Franc</asp:ListItem>
<asp:ListItem Value=”SYP”>Syrian Pound</asp:ListItem>
<asp:ListItem Value=”TWD”>Taiwan Dollar</asp:ListItem>
<asp:ListItem Value=”TZS”>Tanzanian Shilling</asp:ListItem>
<asp:ListItem Value=”THB”>Thai Baht</asp:ListItem>
<asp:ListItem Value=”TOP”>Tonga Pa’anga</asp:ListItem>
<asp:ListItem Value=”TTD”>Trinidad&amp;Tobago Dollar</asp:ListItem>
<asp:ListItem Value=”TND”>Tunisian Dinar</asp:ListItem>
<asp:ListItem Value=”TRL”>Turkish Lira</asp:ListItem>
<asp:ListItem Value=”USD”>U.S. Dollar</asp:ListItem>
<asp:ListItem Value=”AED”>UAE Dirham</asp:ListItem>
<asp:ListItem Value=”UGX”>Ugandan Shilling</asp:ListItem>
<asp:ListItem Value=”UAH”>Ukraine Hryvnia</asp:ListItem>
<asp:ListItem Value=”UYU”>Uruguayan New Peso</asp:ListItem>
<asp:ListItem Value=”VUV”>Vanuatu Vatu</asp:ListItem>
<asp:ListItem Value=”VEB”>Venezuelan Bolivar</asp:ListItem>
<asp:ListItem Value=”VND”>Vietnam Dong</asp:ListItem>
<asp:ListItem Value=”YER”>Yemen Riyal</asp:ListItem>
<asp:ListItem Value=”YUM”>Yugoslav Dinar</asp:ListItem>
<asp:ListItem Value=”ZMK”>Zambian Kwacha</asp:ListItem>
<asp:ListItem Value=”ZWD”>Zimbabwe Dollar</asp:ListItem></asp:DropDownList>
<br />
<br />
<asp:Button ID=”Button1″ runat=”server” Text=”Click”
onclick=”Button1_Click” />
<br />
<br />
<asp:Label ID=”lblAmt” runat=”server”></asp:Label></div>
</form>
</body>
</html>

Now copy following code in .aspx.cs page…

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;public partial class _CurrencyConvertor : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{}
protected void Button1_Click(object sender, EventArgs e)
{
// here we put all code in try-catch
try
{
// create an object of CurrencyConvertor class
myservice.CurrencyConvertor cc = new myservice.CurrencyConvertor();
// create an object of Currency class
myservice.Currency c = new myservice.Currency();
// call ConversionRate method of CurrencyConvertor class
// but it takes parameter of a Currency type so
// here we get this type from enum
double v = cc.ConversionRate((myservice.Currency)System.Enum.Parse(c.GetType(), drpFrom.SelectedValue), ((myservice.Currency)System.Enum.Parse(c.GetType(), drpTo.SelectedValue)));double unit = 0;if ((txtAmt.Text.Trim()!=””)||(txtAmt.Text == null))
{
unit= Convert.ToDouble(txtAmt.Text.Trim());
}

double amt = v * (unit);
lblAmt.Text = “Total Amount = ” + amt;
}
catch (Exception ex)
{

lblAmt.Text = “Error”;
}
}
}

Finally run your webpage…

a7

 

Download Source Code

🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s