473,396 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Ajax in C#

179 100+
I'm just wondering if anyone has used Ajax at all in C# without the use of ASP and if anyone could give me a pointer on getting started?

What I'm trying to do is quite simple, extend a small application which will send an Ajax request and retrieve a link from a website. The particular request is something along the lines of:

Expand|Select|Wrap|Line Numbers
  1. new Ajax.Request(url, {parameters:pars, onComplete:
  2.         function(r) {
  3.             var url = r.responseText;
  4.             Element.hide('loading');
  5.             Element.show('link_block');
  6.             if ('' == url) {
  7.                 $('link').innerHTML = 'Failure: cannot get download url...';
  8.             } else {
  9.                 $('link').innerHTML = '<a href="'+url+'">'+url+'</a>';
  10.             }
  11.         }
  12.     });
Once I've got this, I then actually need to grab the file at that location, however I'm thinking that .NET probably has some built in classes for remote grabbing of files.

What I'm really stumped on is how to easily include the Ajax request, in a purely winforms application, I can't seem to find any simple C# guides in Google. Anyone got any suggestions/starters?

Cheers!
Dec 22 '08 #1
3 2150
Plater
7,872 Expert 4TB
Well ajax is the conceptual realization of a technology in web applications.

For windows applications your have more powerful objects. A similar one would be the HttpWebRequest. You don't need to execute javascript in a windows application.
Dec 22 '08 #2
Curtis Rutland
3,256 Expert 2GB
Well, the reason that you can't find any tutorials is because AJAX has nothing to do with what you want. AJAX is just a nickname for a single javascript object and what you can do with it. So in a browser using JS you would be making an AJAX request, but in a desktop app, you are just making a web request.

You will want to look up HttpWebRequest. There's an example of how to use it near the bottom of the page.

Alternatively you can use the WebClient's DownloadFile method.
Dec 22 '08 #3
NitinSawant
270 100+
Use backgroundworker control in your C# windows app to do your work/call functions asynchronously like AJAX
Dec 26 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Yarco | last post by:
I want to use "Ajax" to create my web for hobby. But i don't know whether "Ajax" is mature... And what about with php? Someone have experience on it? ....
4
by: bobzimuta | last post by:
I'm creating a simple AJAX library. It's an object that will return an array containing the response text or xml. I'm trying to find a way to assign the response as a property of the object, but...
0
by: melledge | last post by:
Ajax Developers' Day added to XTech 2006 agenda XTech 2006 - 17-19 May - Hotel Grand Krasnopolsky - Amsterdam, The Netherlands
0
by: melledge | last post by:
Ajax Developers' Day to Kick Off XTech 2006 Conference Industry experts offer insight into next generation of the Web ALEXANDRIA, VIRGINIA, USA - April 25, 2006 - In response to the rapidly...
1
by: www.web20developers.com | last post by:
http://www.web20developers.com http://www.web20developers.com/index.php?option=com_content&task=view... Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell AJAX -...
10
by: =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?= | last post by:
controlsPlease could some of you here post some of your live examples of AJAX (esp drag panels, collapsable panels, and popup menu.) (It's one thing to talk about how great something is, but it's...
2
by: soni2926 | last post by:
hi, does anyone know of any good books on ajax and asp.net, one that teaches ajax itself before jumping in atlas? I wanted to get an understanding of ajax and how to use it, most books i've seen...
1
by: shaunwo | last post by:
I'm an AJAX / DOM Novice (at best) and trying to figure out how to write the value to a couple input fields. I don't remember exactly where I got the ajax.js file I'm using from (went to the website...
11
by: =?Utf-8?B?R2VyaGFyZA==?= | last post by:
I have run into a situation that if a page/tab that uses the Ajax toolkit (using .net version 3.5) is closed before the Ajax enable controls complete loading, then IE locks up. Does it in both IE7...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.