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

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -