If System.IO.Directory.Exists(HttpContext.Current.Server.MapPath("images/TravelogueGallery/" & getMaxID())) Then
System.IO.Directory.Delete(HttpContext.Current.Server.MapPath("images/TravelogueGallery/" & getMaxID()), True)
End If
I am using the above code snippet to delete a directory but I get this error:
'G:\Projects\Latest\LTCIndia 05-04-12 1415\images\TravelogueGallery\19' is not a valid virtual path.
What's wrong with the code?
UPDATE: I have updated the question with the correct answer. The above code snippet works just fine. Thanks guys for your time.
Server.MapPath
in the syntax HttpContext.Current.Server.MapPath(Server.MapPath(
user1150440 2012-04-05 23:34
If System.IO.Directory.Exists(HttpContext.Current.Server.MapPath("images/TravelogueGallery/" & getMaxID())) Then
System.IO.Directory.Delete(HttpContext.Current.Server.MapPath("images/TravelogueGallery/" & getMaxID()), True)
End If
This is the correct answer. I have updated the question with the correct answer. The above code snippet works just fine. Thanks guys for your time.