473,414 Members | 1,606 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,414 software developers and data experts.

Ajax accessing web site problem

Ben
Hi,
I'm in the process of learning Ajax, and trying to convert examples out
of a book to work in a C#.NET environment. I've hit a snag and need some
guidance.
The example I'm working on attempts to access an outside web site
(GoogleSelect, in fact), and does so by using a PHP script. I'd like to do
this without PHP, using only .NET / Ajax functionality.
The PHP script uses its 'fopen(http://...)' call to access the web site,
and returns (via its $echo command) what the web site returned.
How can I (if it's even possible) write an Ajax method in my page's
code-behind that makes a call to another web site and returns what that web
site provides, doing in essence the same thing the PHP script does.
Can it be done? How?
Thanks,
Ben

If you need further info: bf001<removethis>@abovetheline.biz.
Mar 7 '07 #1
2 980
in Unix tcp streams are just a file open. In .net you use the TcpClient
classes.

-- bruce (sqlwork.com)

Ben wrote:
Hi,
I'm in the process of learning Ajax, and trying to convert examples out
of a book to work in a C#.NET environment. I've hit a snag and need some
guidance.
The example I'm working on attempts to access an outside web site
(GoogleSelect, in fact), and does so by using a PHP script. I'd like to do
this without PHP, using only .NET / Ajax functionality.
The PHP script uses its 'fopen(http://...)' call to access the web site,
and returns (via its $echo command) what the web site returned.
How can I (if it's even possible) write an Ajax method in my page's
code-behind that makes a call to another web site and returns what that web
site provides, doing in essence the same thing the PHP script does.
Can it be done? How?
Thanks,
Ben

If you need further info: bf001<removethis>@abovetheline.biz.

Mar 7 '07 #2
Ben
Ok, I found the answer:

Create an HttpWebRequest object pointing directly to the full URL (with
parameters).
Call the object's GetResponse method to get an HttpWebResponse object.
Feed that into a StreamReader and use the ReadToEnd method to extract
the string reutrned from the web request.

Thanks, all.
Ben
"Ben" <bf************@abovetheline.bizwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi,
I'm in the process of learning Ajax, and trying to convert examples out
of a book to work in a C#.NET environment. I've hit a snag and need some
guidance.
The example I'm working on attempts to access an outside web site
(GoogleSelect, in fact), and does so by using a PHP script. I'd like to
do this without PHP, using only .NET / Ajax functionality.
The PHP script uses its 'fopen(http://...)' call to access the web
site, and returns (via its $echo command) what the web site returned.
How can I (if it's even possible) write an Ajax method in my page's
code-behind that makes a call to another web site and returns what that
web site provides, doing in essence the same thing the PHP script does.
Can it be done? How?
Thanks,
Ben

If you need further info: bf001<removethis>@abovetheline.biz.


Mar 7 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alok yadav | last post by:
I have an open IP and on that IP our main application is hosted. it uses ajax. in web.config file i have register ajax handlers. there are also other sites or project on that IP. now my problem is...
13
by: Karl | last post by:
Hi all. I've recently rebuilt my Vista Ultimate workstation with Visual Studio Team Developer edition. Ive also put on the SQL Server 2005 tools and it's fully patched. I was building a web...
3
by: =?Utf-8?B?bWNpbWFnaW5n?= | last post by:
We have recently applied AJAX to our web site, nothing particularly fancy, just some update panel, progress images and collapsible panels, just the basics to improve the user experience. The...
3
by: Victor | last post by:
hi I just get a problem. in my site all my menu is using Ajax(like the componentart menu). but the website is heavily rely on the web search engine to promote(like Google bot). I think most of the...
2
by: Nathan Sokalski | last post by:
I am moving my website from my machine to my webhost, and need some help with what extra files I need to include due to the fact that I used AJAX in my site. Everything on the site is obviously...
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...
0
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along...
7
by: Joe | last post by:
I added some ajax to my asp.net web site and will Ajax just doesn't seem to work. Does Any one PLEASE have any ideas on why Ajax doesn't work on Apache 2.2.6 w/asp.net 2.0
9
by: =?Utf-8?B?Sko=?= | last post by:
We deployed a website the other day and now one user is getting this error. Of course everyone else is working fine. This error above is followed by Error: 'Type' is Undefined and two Error: 'Sys'...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...

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.