This tutorial will show how we can upload files to a web server and also use a GridView control to delete files as well. C# version.

Quite often, we want to allow uploading of files to a web server, which enables new content to be loaded much quicker & easier than using FTP. ASP.NET makes this easy for us to do, but what happens when we want to delete files from a web server, too? Well ASP.NET, of course, has an answer for this too. We can use a GridView to display files in a certain directory, and allow a user to delete these files.
First, we need the following assembly reference:

We need to add a FileUpload control and a GridView:

The code-behind will look something like this:

Download Source Files