System.ArgumentException: The path is not of a legal form.
For Each gvrow As RepeaterItem In rptBackups.Items Dim chkdelete As CheckBox = DirectCast(gvrow.FindControl("chkSelect"), CheckBox) If chkdelete.Checked Then Dim filePath As String = CType(sender, LinkButton).CommandArgument File.Delete(filePath) Response.Redirect(Request.Url.AbsoluteUri) End If Next
For Each MyControl As RepeaterItem In rptBackups.Items Dim filename As String = CType(MyControl.FindControl("Label1"), Label).Text Dim filePaths As String = "D:/FTP/DB Backup/" & filename Dim chkdelete As CheckBox = DirectCast(MyControl.FindControl("chkSelect"), CheckBox) If chkdelete.Checked Then File.Delete(filePaths) End If Next
CommandArgument
sender
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)