Click here to Skip to main content
15,886,518 members
Articles / Web Development / ASP.NET

AMenu - A Simple .NET Vertical Menu

Rate me:
Please Sign up or sign in to vote.
4.88/5 (26 votes)
8 Oct 2009CPOL4 min read 64K   3.1K   100  
A CSS based .NET vertical menu control.
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


namespace mtweb
{

/////////////////////////////////////////////////////////////////////

public partial class Mail : DControl
{

  ///////////////////////////////////////////////
  // Events

  protected override void OnLoad(EventArgs e)
  {
    base.OnLoad(e);
    if (!UCPostBack) UCPostBack = true;
  }


  protected void Page_Load(object sender, EventArgs e)
  {
    // Parameter expected
    if (!UCPostBack && this.Params != null)
    {
      Parameter p = Params["CommandArgument"];
      if (p != null) MailTo.Text = p.DefaultValue;
    }
  }


  ///////////////////////////////////////////////
  // Properties

  protected bool UCPostBack
  {
    get { 
      return ViewState["UCPostBack"] == null ? false : true;
    }
    set { ViewState["UCPostBack"] = true; }
  }


  protected DefaultPage DefPage
  {
    get { return this.Page as DefaultPage; }
  }


  ///////////////////////////////////////////////
  // Click handlers

  protected void OnCloseClick(object sender, ImageClickEventArgs e)
  {
    DefPage.CloseContent();
  }


  protected void OnSubmitClick(object sender, ImageClickEventArgs e)
  {
    System.Threading.Thread.Sleep(3000);
  }


}  // class
}  // namespace

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
Europe Europe
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions