I got answer but it is also not working on my machine
and gives following error :
The underlying connection was closed: Unable to connect to the remote
server
And code used is (VB.NET) :
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>
<script language="C#" runat="server">
void Page_Load(Object Src, EventArgs E) {
myPage.Text = readHtmlPage
("http://aspalliance.com/stevesmith/");
}
private String readHtmlPage(string url)
{
String result;
WebResponse objResponse;
WebRequest objRequest = System.Net.HttpWebRequest.Create(url);
objResponse = objRequest.GetResponse();
using (StreamReader sr =
new StreamReader(objResponse.GetResponseStream()) )
{
result = sr.ReadToEnd();
// Close and clean up the StreamReader
sr.Close();
}
return result;
}
</script>
<html>
<body>
<b>This content is being populated from a separate HTTP request to
<a
href="http://aspalliance.com/stevesmith/">http://aspalliance.com/steve
smith/</a>:</b><hr/>
<asp:literal id="myPage" runat="server"/>
</body>
</html>