Embedding ASP.NET page into another page

By Nitin

First import System.IO and System.Net into the codebehind file of the page.

Take a label on the page say Label1.

add following function to the class:-

Private Function GetPageOutput(ByVal url As String) As String

Dim wr As WebRequest = WebRequest.Create(url)

Dim sr As StreamReader = New StreamReader(wr.GetResponse().GetResponseStream())

Return sr.ReadToEnd()

End Function

Take a button say Button1, in click event of Button1

call the PageOutput function as

Label1.Text=PageOutput(“http://www.google.com“)

finished, The child page content will be embeded into the current page

Tags: ,

तुमचा अभिप्राय नोंदवा