Kriya and Meditation for Software / IT Professionals. Conducted by Bipin Joshi in Thane. Read more...
Learn ASP.NET MVC, ASP.NET Core and ASP.NET Design Patterns. Courses conducted by Bipin Joshi on weekends. Click here for more details.

<%@ Page %>

FREE Web Site File Manager User Control (Ver.1.0)

Introduction

ASP.NET Custom user controls and web controls provide great amount of code reuse and flexibility. This FREE user control is a file manager for typical web sites. The download also includes a sample ASPX page ready to use in your applications. This is Ver.1.0 of the control. Based on user feedback and suggestions I will enhance it further. So don't forget to drop me a line at <% displaylink "bipinjoshi@yahoo.com","mailto:bipinjoshi@yahoo.com",true,false %>

Functionality in Ver 1.0

The current version provides following functionality :
  • Folder creation
  • Folder deletion
  • Multiple File Deletion
  • Multiple File Move (Cut/Paste)
  • File Rename
  • Single File Upload

Screen Shot

Click here to view screen shot

Known issues

Following are the known facts about the control :
  • In case if deletion of folder fails no error message is displayed
  • No warning is displayed while deleting files/folders
However, note that above is not a complete list. There can be other flaws present.

How to use the user control?

If you are using VS.NET then follow these steps in order to consume File Manager Control:
  • Create a new ASP.NET project in VS.NET
  • Add reference to sitefilemanager.dll
  • Add sample.aspx and sitefilemanagercontrol.ascx to the project
  • Make sure that in sitefilemanagercontrol.ascx you inherit from SiteFileManager.SiteFileManagerControl class.
  • Set sample.aspx as default page
  • Also, note that the user control uses two session variables of type string. You must enable session state for the web form (ASPX page).
  • Run the application
If you are not using VS.NET and code-behind approach follow these steps:
  • Copy sample.aspx to your virtual root
  • Copy sitefilemanagercontrol.ascx to your virtual root
  • Copy sitefilemanager.dll in the bin folder of your virtual root
  • Make sure that in sitefilemanagercontrol.ascx you inherit from SiteFileManager.SiteFileManagerControl class.
  • Also, note that the user control uses two session variables of type string. You must enable session state for the web form (ASPX page).
  • Run the application

Further Enhancements

Following enhancements can be done :
  • Mark folders marked for 'Cut' with different color
  • Confirm file/folder delete
  • Convert user control into web control (.dll rather than .ascx)
  • Error message to be displayed in case folder deletion fails

So, go ahead and use this FREE control in your applications.

Download

The ZIP file contains :
  • Sample.aspx : A ready to use web form that hosts the user control
  • sitefilemanager.dll : Includes all the code needed to run the file manager
  • sitefilemanagercontrol.ascx : User control file that contains various elements of the control.

Bipin Joshi is a software consultant, an author and a yoga mentor having 22+ years of experience in software development. He also conducts online courses in ASP.NET MVC / Core and Design Patterns. He is a published author and has authored or co-authored books for Apress and Wrox press. Having embraced the Yoga way of life he also teaches Meditation and Mindfulness to interested individuals. To know more about him click here.

Get connected : Twitter  Facebook  Google+  LinkedIn

Posted On : 16 November 2001


Tags : ASP.NET Server Controls Custom Controls Administration