|
|
 |
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
 | This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

February 10th, 2009, 08:43 AM
|
|
Authorized User
|
|
Join Date: Jan 2009
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ASP.NET AJAX
I have a website for which I change the currency conversion rate for the dollar vs the euro every day. After reading the chapter on AJAX, I got the impression that I should be able to program this into my website to do automatically through web services. Is my thinking correct?
|

February 10th, 2009, 03:20 PM
|
 |
Wrox Author
Points: 33,563, Level: 80 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,231
Thanks: 7
Thanked 203 Times in 201 Posts
|
|
Hi areed24,
You can certainly use web services for this. Not sure where AJAX fits in though. You typically convert only once a day (or maybe more often) and then store the exchange rate somewhere on the server so you can reuse it many times.
What's your use case for doing this client side? That is, why would you want to use AJAX to do this in the browser?
Imar
|

February 20th, 2009, 01:29 PM
|
|
Authorized User
|
|
Join Date: Jan 2009
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I misunderstood what I read. Do you have a suggestion as to how I could update the currency conversion rate without doing it manually?
|

February 21st, 2009, 06:25 AM
|
 |
Wrox Author
Points: 33,563, Level: 80 |
|
|
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,231
Thanks: 7
Thanked 203 Times in 201 Posts
|
|
First you need to find a (free or paid) service that allows you to do the conversion. For this, search Google and you'll find a lot of results.
Depending on the service, you typically use a Web Service to get their data, although plain XML or simple http requests are common as well. Then at your server, where you need the currency you can do something like this (pseudo) code:
If currency not in the cache then
' Connect to your conversion service
' Get the conversion rate
' Store the conversion rate in the cache
End if
Return the conversion rate.
By storing it in the cache, you don't have to connect to the remote service every time you need the rate....
Hope this helps,.
Imar
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |