image not being released [modified]
-
hi to all, I have a grid view (ASP.NET 2.0) that displays a list of products, when i click the delete image the row is deleted, then in the
RowDeleted
handler i attempt to delete the products images folder. and i get a message say the directory is locked by another process. I assume the process is the browser, but i dont see why if the row is deleted. How do i get around this problem, so I dont have unwanted fs directories laying about. this is my codeprotected void gridProducts_RowDeleted(object sender, GridViewDeletedEventArgs e)
{
if (e.Exception == null)
{
string code = (string)e.Values["ProductCode"];string path = SiteConfiguration.ProductImagesUploadDirectory; path = Server.MapPath(path); path = Path.Combine(path, code); if (Directory.Exists(path)) { Directory.Delete(path, true); } }
}
kind regards, g00fy
-
hi to all, I have a grid view (ASP.NET 2.0) that displays a list of products, when i click the delete image the row is deleted, then in the
RowDeleted
handler i attempt to delete the products images folder. and i get a message say the directory is locked by another process. I assume the process is the browser, but i dont see why if the row is deleted. How do i get around this problem, so I dont have unwanted fs directories laying about. this is my codeprotected void gridProducts_RowDeleted(object sender, GridViewDeletedEventArgs e)
{
if (e.Exception == null)
{
string code = (string)e.Values["ProductCode"];string path = SiteConfiguration.ProductImagesUploadDirectory; path = Server.MapPath(path); path = Path.Combine(path, code); if (Directory.Exists(path)) { Directory.Delete(path, true); } }
}
kind regards, g00fy
-
hi to all, I have a grid view (ASP.NET 2.0) that displays a list of products, when i click the delete image the row is deleted, then in the
RowDeleted
handler i attempt to delete the products images folder. and i get a message say the directory is locked by another process. I assume the process is the browser, but i dont see why if the row is deleted. How do i get around this problem, so I dont have unwanted fs directories laying about. this is my codeprotected void gridProducts_RowDeleted(object sender, GridViewDeletedEventArgs e)
{
if (e.Exception == null)
{
string code = (string)e.Values["ProductCode"];string path = SiteConfiguration.ProductImagesUploadDirectory; path = Server.MapPath(path); path = Path.Combine(path, code); if (Directory.Exists(path)) { Directory.Delete(path, true); } }
}
kind regards, g00fy