Is there a function to determine whether a URI is a valid virtual path? I'm given a string and need to use Server.MapPath() on it without throwing an Exception when the string is not a valid virtual path.
Vote to close my question. Answer is @ asp.net - Is my path virtual?.
You could use the
File.Exists() and Directory.Exists()
methods to check the output ofServer.MapPath()
and verify that a file/directory exists at the specified path.