Click here to Skip to main content
15,891,943 members
Articles / Web Development / XHTML

Powerful File manager

Rate me:
Please Sign up or sign in to vote.
4.13/5 (12 votes)
27 Jun 2008CPOL4 min read 55.2K   3.7K   65  
A Powerful File manager in pure asp.net
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for MyLinkButton
/// </summary>
public class MyLinkButton:Label
{
    private Image im;
    private Label li;
    private string url;
    public MyLinkButton()
        : base()
    {
        base.Text = "";
        li = new Label();        
        im = new Image();
        im.ImageAlign = ImageAlign.Middle;
        this.Controls.Add(im);
        this.Controls.Add(li);
        this.Text = "<a href=''></a>";
        url = "";
    }
	public MyLinkButton(string txt,string imgUrl)
        :base()
	{
		//
		// TODO: Add constructor logic here
		//
        base.Text = "";
        li = new Label();
        li.Text = txt;
        im = new Image();
        im.ImageUrl = imgUrl;
        im.ImageAlign = ImageAlign.Middle;
        this.Controls.Add(im);
        this.Controls.Add(li);
        url = "";
	}
    public ImageAlign ImageAlign
    {
        get
        {
            return im.ImageAlign;
        }
        set
        {
            im.ImageAlign = value;
        }
    }
    public string ImageUrl
    {
        set
        {
            im.ImageUrl = value;
        }
        get
        {
            return im.ImageUrl;
        }
    }
    public override string Text
    {
        get
        {
            return li.Text;
        }
        set
        {
            li.Text = value;
        }
    }
    public string Url
    {
        get
        {
            return url;
        }
        set
        {
            url = value;
            li.Text = "<a href='" + url + "' class='"+this.CssClass+"'>" + li.Text + "</a>";
        }
    }
   /* protected override void OnClick(EventArgs e)
    {
        base.OnClick(e);
        if (url != "")
            Page.Response.Redirect(url);
    }*/
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Austria Austria
I am Mohsen Ahmadian,
I was born in Tehran (capital city of Iran), I live in Vienna
I am a freelancer and a web developer
I Love Codeproject and C++, Java, C#, PHP
if you found my articles are good, buy a coffee for me
https://www.buymeacoffee.com/mohsenahmadian

Comments and Discussions