473,508 Members | 2,361 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Load a URL's execution result

Hello,

I am developing an application whose main goal is to read from a dynamic
..asp Internet URL. This URL automatically produces an RSS file, which I
further want to load into my application so as to manilupate the source
and render the results into an HTML page using ASP.NET and C#.
My problem is how (which classes and methods of ASP.NET in C# do I use)
do I read this .asp page and import the produced .rss file into my
XmlDocument in the Page_Load ( ) event.

================================================== ================================================== =========================
This is what I have implemented so far, but it doesnt work unless the
feedURL is read directly from a local static file.
public class DisplayRSS : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Xml MyXMLWebControl;
string feedURL="test.rss"; /* But in the real case I want to
read from
the dynamic .asp file that produces the .rss file */

private void Page_Load(object sender, System.EventArgs e)
{
XmlDocument mylist = new XmlDocument();
mylist.Load(feedURL);
MyXMLWebControl.Document = mylist;

/*Here I move on with setting the properties for the associated XLST for
parsing the rss file and rendering the results on my ASP.NET page */

}
}

================================================== ================================================== =========================
Any help and ideas on this would be more than welcome.
stevag

Nov 17 '05 #1
2 8315
> string feedURL="test.rss"; /* But in the real case I want to
read from
the dynamic .asp file that produces the .rss file */

Here's a simple way to read the results from an URL:

using System.Net;
using System.Xml;

// Set up the request to the server
HttpWebRequest myRequest =
(HttpWebRequest)HttpWebRequest.Create("http://www.yahoo.com");
myRequest.Method = "GET";

// Read the response from the server
HttpWebResponse myResponse = (HttpWebResponse) myRequest.GetResponse();
StreamReader read = new StreamReader(myResponse.GetResponseStream());
string sXML = read.ReadToEnd();
myResponse.Close();

// Process the answer from the server
XmlDocument xmlDoc = new XmlDocument();
// Expect an expection here: yahoo.com doesn't return an XML document.
xmlDoc.LoadXml( sXML );

Greetings,
Wessel
Nov 17 '05 #2
If URL is hosted on your server, u can use Server.Execute, otherwise u
should use HttpWebRequest as Wessel pointed out..

--
HTH

Thanks,
Yunus Emre ALPÖZEN
BSc, MCSD.NET

"stevag" <ev********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hello,

I am developing an application whose main goal is to read from a dynamic
.asp Internet URL. This URL automatically produces an RSS file, which I
further want to load into my application so as to manilupate the source
and render the results into an HTML page using ASP.NET and C#.
My problem is how (which classes and methods of ASP.NET in C# do I use) do
I read this .asp page and import the produced .rss file into my
XmlDocument in the Page_Load ( ) event.

================================================== ================================================== =========================
This is what I have implemented so far, but it doesnt work unless the
feedURL is read directly from a local static file.
public class DisplayRSS : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Xml MyXMLWebControl;
string feedURL="test.rss"; /* But in the real case I want to read
from
the dynamic .asp file that produces the .rss file */

private void Page_Load(object sender, System.EventArgs e)
{
XmlDocument mylist = new XmlDocument();
mylist.Load(feedURL);
MyXMLWebControl.Document = mylist;

/*Here I move on with setting the properties for the associated XLST for
parsing the rss file and rendering the results on my ASP.NET page */

}
}

================================================== ================================================== =========================
Any help and ideas on this would be more than welcome.
stevag

Nov 17 '05 #3

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

Similar topics

4
1769
by: simon | last post by:
Hi, I have a fairly complicated script that seems to load fairly fast. But that's because it is on my local server in the office and not on the main one, (and I am the only one on it). So I...
6
3224
by: Shabam | last post by:
A web application of mine developed using C# + MS SQL runs fine normally. However when I stress test it with a load testing software (using about 60 simultaneous users) some instances start...
1
5024
by: Carmine | last post by:
I'm getting this error when I submit the job: DSNU000I DSNUGUTC - OUTPUT START FOR UTILITY, UTILID = LOADSQL DSNU005I DSNUGPRS - EXEC SQL DSNU082I DSNUGPRS - INVALID KEYWORD - EXEC...
6
8559
by: B B | last post by:
Okay, here is what's happening: I have a reasonably fast laptop (1.4 GHz Mobile M, so comparable to 2.5GHz P4) doing .net development. Running Windows XP pro, SP2 IIS is installed and running...
11
2347
by: Jason | last post by:
Hi I have a "problem" i have got a ASP.NET application. in this application i have included logging. in the logging i have logged how many seconds it takes for this application to fully load....
0
841
by: stevag | last post by:
Hello, I am developing an application whose main goal is to read from a dynamic ..asp Internet URL. This URL automatically produces an RSS file, which I further want to load into my application...
2
1612
by: TS | last post by:
when i try to do a response.flush and .end, the screen ends up blank. I want all page processing to quit when a check in the pageload event fails. Since control events occur after load, how do i...
19
2264
by: natG | last post by:
On a warehouse app, our Java clients constantly load/insert rows into the db. I would like to throttle these inserts (1.5 million rows per hr) from the Java app, based on current 'busy state' of...
2
6548
by: David Thielen | last post by:
So we have moved our app from .NET version 2.X in IIS6 to a Windows 2008 Server running IIS7. We have copied all files to the Windwardreports\apps directory and that apps directory has been...
0
7223
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
7321
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,...
1
7036
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
7489
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...
0
5624
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
3191
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
414
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.