Test Link Page Exists?

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.
 
C

Carlos Albert

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top