Hello,
I have an issue when trying to delete a file from a folder.
When I try to download it works fine but deleting doesn't work at all despite them using the same path.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadGridData();
}
}
protected void LoadGridData()
{
string[] filePaths = Directory.GetFiles(Server.MapPath("~/Uploads/"));
List<ListItem> files = new List<ListItem>();
foreach (string filePath in filePaths)
{
string fileName = Path.GetFileName(filePath);
files.Add(new ListItem(fileName, "~/Uploads/" + fileName));
}
GridView1.DataSource = files;
GridView1.DataBind();
}
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e. ...
Go to the complete details ...