Test Link Page Exists?

  • Thread starter Thread starter xenophon
  • Start date Start date
X

xenophon

I have a NavigateUrl property on a page that is this:

MyLink.NavigateUrl = "~/testpage.aspx";

I want to programmatically load testpage.aspx so I can tell if it is
really there. This will be a test I run from one page on the web site
for another page. It's not called all the time, just as a debug test.
WebClient namespace?

ASP.NET 2.0.

Thanks.
 
I would use this:
Dim web As New System.Net.WebClient
Dim download As Byte()
Dim ASCII As New System.Text.ASCIIEncoding
download = web.DownloadData("http://url.com")
Dim page as String = ASCII.GetString(download)

Then you have the page stored to test whatever you want.
 
Back
Top