By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,671 Members | 1,568 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,671 IT Pros & Developers. It's quick & easy.

Help

P: n/a
Is there any way to get HTML code from one web site to another one in
ASP.NET?
e.g. in my web form, I want to get information from other site but that site
only provides HTML page. Can I get this HTML page in ASP.NET routine?

Shawn
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Shawn,

Yes, you can. Take a look at the WebClient class, or the HttpWebRequest
and HttpWebResponse classes if the requests you have to make are more
complex. They will allow you to get the contents of another site from
within ASP.NET.

Be careful though, by default, ASP.NET runs under the local ASPNET user
account, which doesn't have access to the network, so you will have to
change it so that routine runs in an account that has the appropriate
permissions.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Shawn Zheng" <sz********@rogers.com> wrote in message
news:OZ**************@TK2MSFTNGP14.phx.gbl...
Is there any way to get HTML code from one web site to another one in
ASP.NET?
e.g. in my web form, I want to get information from other site but that
site
only provides HTML page. Can I get this HTML page in ASP.NET routine?

Shawn

Nov 16 '05 #2

P: n/a
Shawn,
I've done this before, it's pretty simple, and .NET provides some great
mechanisms for doing it.

A quick search came up with this tutorial:
http://www.csharp-station.com/HowTo/HttpWebFetch.aspx

Hope it helps

-Andrew

"Shawn Zheng" wrote:
Is there any way to get HTML code from one web site to another one in
ASP.NET?
e.g. in my web form, I want to get information from other site but that site
only provides HTML page. Can I get this HTML page in ASP.NET routine?

Shawn

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.