473,748 Members | 8,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Ajax in C#

179 New Member
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 2166
Plater
7,872 Recognized Expert Expert
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 Recognized Expert Specialist
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 Contributor
Use backgroundworke r 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
2342
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
4326
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 from within an inline function. Within the AJAX object: this.xmlhttp = new XMLHttpRequest(); this.response = ''; //to contain the response text OR xml var that = this; //since we cannot reference this within the
0
1845
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
1839
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 developing world of Ajax user interfaces on the browser, IDEAlliance (www.idealliance.org) announced today that its annual XTech Conference will kick off on May 16 with Ajax Developers' Day. XTech 2006 (www.xtech-conference.org), to be held May...
1
16509
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 - microlink pattern tutorial : A microlink is a link that opens up
10
3071
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 another to really see how great something is.) Thanks -- Share The Knowledge. I need all the help I can get and so do you!
2
2262
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 on .net and ajax seem to jump into atlas right away, does anyone know of any that teach ajax itself and then later get into atlas?
1
3415
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 that I see in the comments, but no luck there), but what I already have works GREAT to populate the options in a select box. Now I'm trying to take that same code and get it to write the value to a couple input boxes. Here's a link to my ajax...
11
3043
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 and IE8. There is no issue when the controls are allowed to complete loading. Can you please tell me the best practice that handles this? Thanks.
0
8987
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9534
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9366
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.