Author: kiranti | Posted on: 3/8/2009 8:53:33 PM | Views : 251

I have a database table named tblIMAGE with a field named ImagePath that store a url (path) to my image in folder named ~/imagesfolder

I bind an image control to this table to show the images using "~/imagesfolder/" & Eval("ImagePath")
and then I put a button to delete the image in that folder.
This is the code for delete button :
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim xdir As String = Server.MapPath("~/imagesfolder/")
Dim r As String = CType(sender, System.Web.UI.WebControls.Button).CommandArgument
Dim f As String = xdir & r

File.Delete(f)

End SubThis is because i just want to delete the image not including the records in ImagePath.The file deleted successfu ...

Go to the complete details ...