Protected Sub DetailsView1_ItemInserting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewInsertEventArgs) Dim f As FileUpload = DetailsView1.FindControl("FileUpload1") If f.HasFile Then '' 保存文件 End If End Sub |
Protected Sub FormView1_ItemDeleted(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewDeletedEventArgs) If (e.Exception Is Nothing) Then '' 删除文件 Response.Redirect(e.Values("AlbumID")) End If End Sub |