Wrox Programmer Forums
|
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 Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 10th, 2009, 08:43 AM
Authorized User
 
Join Date: Jan 2009
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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?
 
Old February 10th, 2009, 03:20 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old February 20th, 2009, 01:29 PM
Authorized User
 
Join Date: Jan 2009
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I misunderstood what I read. Do you have a suggestion as to how I could update the currency conversion rate without doing it manually?
 
Old February 21st, 2009, 06:25 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
asp.net ajax tookit, included in Asp.net 3.5 PeterPeiGuo Visual Web Developer 2008 1 January 6th, 2009 04:25 AM
ASP.NET 2.0 Ajax raminriahi General .NET 2 September 5th, 2007 12:48 PM
Turning a regular ASP.NET App into an AJAX ASP.Net donrafeal7 Ajax 2 August 31st, 2007 12:33 AM
ajax in asp.net imjayakumar Crystal Reports 0 April 3rd, 2007 07:26 AM
ASP.NET AJAX inkrajesh ASP.NET 2.0 Professional 3 January 19th, 2007 03:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.