Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8278309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:57:59+00:00 2026-06-08T08:57:59+00:00

How do I check if a page exists without wrapping it in a try

  • 0

How do I check if a page exists without wrapping it in a try catch

Dim myWebResponse As HttpWebResponse = CType(myWebRequest.GetResponse(), HttpWebResponse)

If the page does not exist then I get a 404 exeption when myWebRequest.GetResponse() fires.

Isnt there some thing like myWebRequest.DoesPageExist() that returns true of false or the status?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:58:00+00:00Added an answer on June 8, 2026 at 8:58 am

    This is not possible.

    To check if a page exists, you have to execute the web request, and the server will return an error code, if the page does not exist. If the page exists, the server returns the page content. All this is one in a single server request, if you would check first, you would need two server requests, which is unefficient.

    When you execute a web request, you should always catch exceptions, because lots of unexpected things could happen. Not only that the page does not exists, the connection could timeout or break, the server itself is down…. and you should catch all these exceptions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote this method to check if a page exists or not: protected bool
i have a signup page and i want to check username exists or not
I'm writing an .htaccess file that will check if a requested page exists in
How do I check if a facebook page, group, or person exists using php?
Would it be wiser to check if a particular element exists on the page?
Is there any way to check that my page is not opened in another
I want to check if a particular page gets redirected or not. However, whenever
I need to check if a webpage exists if it does whether a certain
I have a winform app that requires me to check whether a page exists
I would like to check if a page exists. My file is article.php .

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.