how to fetch small piece of information from other web site into asp.net web application

In Classical ASP, this process can be done using the following:

Dim xml,strRetrive
set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "GET", "http://www.abc.com/viewProduct/?productNumber="&sCode  , false
xml.Send
strRetrive=xml.responseText

How can we do this in ASP.NET?

Answers


Use a System.Net.WebClient:

Using c As New Net.WebClient()
    retrieved = c.DownloadString("http://www.abc.com/viewProduct/?productNumber=" & sCode)
End Using

Need Your Help

The behavior of animated gif in WebView is very strange!!, how to fix this?

android android-webview

I have an application with a WebView, where there's a long list of posts that Autoloads via Ajax when the user approaches the bottom of the scrollable area, so I display the word "Loading ... " and...

WP8 - How can I make the background agent execution to wait before all ImageOpened events are fired to update live tile with custom images?

windows-phone-8 bitmapimage writeablebitmap background-agents secondary-live-tile

How can I make the background agent execution to wait before all ImageOpened() events are fired (3 in this case) in order to update secondary live tile with custom images?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.