Strangely this may be my issue and I don't know why.
I tried moving where the documents are to just C:\Documents\ACSDocs\ on the server, gave it rights to Network Service, dropped a button on it and a text dox and have one line:
Deletes the file no problem. So I thought I had a fix, changed the code to point to that directory:Code:System.IO.File.Delete(txtTestDelete.Text)
Run the application again, get the same Access Denied error. Both my Test.aspx page and my real .aspx page live in the same directory. I'm a bit at a loss. You think the GridView somehow is screwing it up?Code:If e.CommandName = "Delete" Then Dim oSQL As New clsSQL Dim strFileName As String = "" oSQL.GetFileName(strFileName, gvFiles.DataKeys(e.CommandArgument).Value()) 'Dim strFilePath As String = Server.MapPath("~\ACSDocs\" & strFileName) Dim strFilePath As String = "C:\Documents\ACSDocs\" & strFileName System.IO.File.Delete(strFilePath) oSQL.DeleteACSDocs(gvFiles.DataKeys(e.CommandArgument).Value()) oSQL.LoadACSDocs() gvFiles.DataSource = oSQL.Dataset.Tables("ACSDocs") gvFiles.DataBind() End If





Reply With Quote