redirect - In Asp.Net, check for existence of aspx page before redirecting to it? -


How can I check the existence of an aspx page before I try to redirect it, So that's my C # code in that case?

  response. Radical ("~ / SomePage.aspx")  

But I have to make sure that the page actually exists before I call it. It works with the string after all, so maybe I have some type or something else, or maybe I have not created that page yet.

Do one on the page.

  if (file example (server.mappath ("~ / SomePage.aspx"))) Response.Redirect ("~ / SomePage.aspx");  

You have a system Io will use the namespace.


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -