Quote Originally Posted by sapator View Post
Can you try deleting outside a gridview? I am not sure how well the server is behaving with in grid delete.
Also try changing to this: Server.MapPath("\\ACSDocs\ ..... etc)
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:

Code:
System.IO.File.Delete(txtTestDelete.Text)
Deletes the file no problem. So I thought I had a fix, changed the code to point to that directory:

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
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?