當前位置: 首頁>>代碼示例>>C#>>正文


C# WebControls.Menu類代碼示例

本文整理匯總了C#中System.Web.UI.WebControls.Menu的典型用法代碼示例。如果您正苦於以下問題:C# Menu類的具體用法?C# Menu怎麽用?C# Menu使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Menu類屬於System.Web.UI.WebControls命名空間,在下文中一共展示了Menu類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: setMenuData

        protected void setMenuData()
        {
            Menu menu = new Menu();
            MenuItem item;

            item = new MenuItem();
            item.Text = "Home Page";
            item.Value = "valueHomePage";
            menu.Items.Add(item);
            item = null;

            item = new MenuItem();
            item.Text = "Contact Us";
            item.Value = "valueContactUs";
            menu.Items.Add(item);
            item = null;

            item = new MenuItem();
            item.Text = "Productions";
            item.Value = "valueProductions";
            menu.Items.Add(item);
            item = null;

            item = new MenuItem();
            item.Text = "Compare";
            item.Value = "valueCompare";
            menu.Items.Add(item);
            item = null;

            item = new MenuItem();
            item.Text = "Links";
            item.Value = "valueLinks";
            menu.Items.Add(item);
            item = null;
        }
開發者ID:salahmyn,項目名稱:galileovietnam,代碼行數:35,代碼來源:LeftMenuControl.ascx.cs

示例2: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     Menu navbar = new Menu(nav);
        if (!Page.IsPostBack)
        {
             dt = conec.Productos();
             DataList1.DataSource = dt;
             DataList1.DataBind();
        }
 }
開發者ID:ramonramirezz,項目名稱:TechStore,代碼行數:10,代碼來源:productos.aspx.cs

示例3: Page_Load

        //DataTable dt = new DataTable();
        protected void Page_Load(object sender, EventArgs e)
        {
            Menu navbar = new Menu(nav);

               //if (!Page.IsPostBack)
               //{
               //dt = conec.Carrito();
               //GridView1.DataSource = dt;
               //GridView1.DataBind();
               //}
        }
開發者ID:ramonramirezz,項目名稱:TechStore,代碼行數:12,代碼來源:carrito.aspx.cs

示例4: MenuBindingsEditorForm

 public MenuBindingsEditorForm(IServiceProvider serviceProvider, System.Web.UI.WebControls.Menu menu, MenuDesigner menuDesigner) : base(serviceProvider)
 {
     this._menu = menu;
     this.InitializeComponent();
     this.InitializeUI();
     foreach (MenuItemBinding binding in this._menu.DataBindings)
     {
         MenuItemBinding clone = (MenuItemBinding) ((ICloneable) binding).Clone();
         menuDesigner.RegisterClone(binding, clone);
         this._bindingsListView.Items.Add(clone);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:12,代碼來源:MenuBindingsEditorForm.cs

示例5: Page_Load

        protected void Page_Load(object sender, EventArgs e)
        {
            Models.PoliklinikEntities4 p=new Models.PoliklinikEntities4();

            var res = from c in p.UrunKategori select new {Adi = c.Adi };
            Menu m = new Menu();
            foreach (var item in res.ToList())
            {
             MenuItem l=new MenuItem();
                l.Value=item.Adi;
                m.Items.Add(l);
                Menu1.Items.Add(l);
            }
        }
開發者ID:tamerin1,項目名稱:e-commerce,代碼行數:14,代碼來源:WebForm1.aspx.cs

示例6: bindMenuProLb

 protected void bindMenuProLb(Menu MenuProLb)
 {
     SQLHelper.Setup();
     List<DXLb> lbs = SQLHelper.GetEntities<DXLb>(" IsDeleted=0 AND parentid = 0 Order By OrderId");
     foreach (DXLb lb in lbs)
     {
         MenuItem menuNode = new MenuItem();
         menuNode.Text = lb.LbName;
         menuNode.Value = lb.Id.ToString();
         menuNode.NavigateUrl = "Prod.aspx?lbid=" + lb.Id;
         menuNode.Enabled = true;
         MenuProLb.Items.Add(menuNode);
         parentid_ = lb.Id;
         addChildMenu(menuNode);
     }
 }
開發者ID:uwitec,項目名稱:dx-shopsys,代碼行數:16,代碼來源:LeftMenu.aspx.cs

示例7: SetearOpcionesConsultor

        private void SetearOpcionesConsultor(Menu menuPrincipal)
        {
            SetearOpcionesGeneral(menuPrincipal);

            menuPrincipal.Items.Remove(menuPrincipal.FindItem("Cliente"));

            // Buscar el item Vehiculo
            MenuItem menuVehiculo = menuPrincipal.FindItem("Vehiculo");

            // Buscar cada subitem del item Vehiculo
            MenuItem venderVehiculo = menuPrincipal.FindItem("Vehiculo/VenderVehiculo");
            MenuItem registrarVehiculo = menuPrincipal.FindItem("Vehiculo/RegistrarVehiculo");
            MenuItem modificarVehiculo = menuPrincipal.FindItem("Vehiculo/ModificarVehiculo");
            MenuItem caracteristicasVehiculo = menuPrincipal.FindItem("Vehiculo/CaracteristicasVehiculo");
            MenuItem eliminarVehiculo = menuPrincipal.FindItem("Vehiculo/EliminarVehiculo");

            // Eliminar cada subitem del item Vehiculo
            menuVehiculo.ChildItems.Remove(venderVehiculo);
            menuVehiculo.ChildItems.Remove(registrarVehiculo);
            menuVehiculo.ChildItems.Remove(modificarVehiculo);
            menuVehiculo.ChildItems.Remove(caracteristicasVehiculo);
            menuVehiculo.ChildItems.Remove(eliminarVehiculo);
        }
開發者ID:nMoschen,項目名稱:NET_TP2,代碼行數:23,代碼來源:Home.aspx.cs

示例8: SetDataBindings

		void SetDataBindings (Menu menu) {
			MenuItemBinding b = new MenuItemBinding ();
			b.DataMember = "node";
			b.EnabledField = "enabled";
			b.Enabled = false;
			b.ImageUrlField = "img";
			b.ImageUrl = "img#default";
			b.NavigateUrlField = "url";
			b.NavigateUrl = "url#default";
			b.PopOutImageUrlField = "popoutimg";
			b.PopOutImageUrl = "popoutimg#default";
			b.SelectableField = "selectable";
			b.Selectable = false;
			b.SeparatorImageUrlField = "separatorimg";
			b.SeparatorImageUrl = "separatorimg#default";
			b.TargetField = "target";
			b.Target = "target#default";
			b.FormatString = "text#{0}";
			b.TextField = "text";
			b.Text = "text#default";
			b.ToolTipField = "tooltip";
			b.ToolTip = "tooltip#default";
			b.ValueField = "value";
			b.Value = "value#default";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "root";
			b.Enabled = false;
			b.ImageUrl = "img#root";
			b.NavigateUrl = "url#root";
			b.PopOutImageUrl = "popoutimg#root";
			b.Selectable = false;
			b.SeparatorImageUrl = "separatorimg#root";
			b.Target = "target#root";
			b.Text = "text#root";
			b.ToolTip = "tooltip#root";
			b.Value = "value#root";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra1";
			b.Text = "text#extra1";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra2";
			b.Value = "value#extra2";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra3";
			b.TextField = "text";
			b.ValueField = "value";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra4";
			b.TextField = "text";
			b.Text = "text#default";
			b.ValueField = "value";
			menu.DataBindings.Add (b);

			b = new MenuItemBinding ();
			b.DataMember = "extra5";
			b.TextField = "text";
			b.Value = "value#default";
			b.ValueField = "value";
			menu.DataBindings.Add (b);
		}
開發者ID:JokerMisfits,項目名稱:linux-packaging-mono,代碼行數:70,代碼來源:MenuTest.cs

示例9: fillMenu

		private static void fillMenu (Menu m) {
			m.Items.Clear ();
			m.Items.Add (new MenuItem ());
			m.Items [0].ChildItems.Add (new MenuItem ());
			m.Items [0].ChildItems.Add (new MenuItem ());
			m.Items [0].ChildItems [0].ChildItems.Add (new MenuItem ());
		}
開發者ID:JokerMisfits,項目名稱:linux-packaging-mono,代碼行數:7,代碼來源:MenuTest.cs

示例10: GetClientEvent

		string GetClientEvent (Menu owner, MenuItem item)
		{
			if (owner == null)
				owner = Owner;

			Page page = owner.Page;
			ClientScriptManager csm = page != null ? page.ClientScript : null;

			if (csm == null)
				return String.Empty;
			
			return csm.GetPostBackClientHyperlink (owner, item.Path, true);
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:13,代碼來源:BaseMenuRenderer.cs

示例11: GetArrowResourceUrl

		public string GetArrowResourceUrl (Menu owner) 
		{
			Page page = owner.Page;
			ClientScriptManager csm = page != null ? page.ClientScript : null;
			if (csm != null)
				return csm.GetWebResourceUrl (typeof (Menu), "arrow_plus.gif");

			return null;
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:9,代碼來源:BaseMenuRenderer.cs

示例12: RenderItemHref

		public virtual void RenderItemHref (Menu owner, HtmlTextWriter writer, MenuItem item)
		{
			if (!item.BranchEnabled)
				writer.AddAttribute ("disabled", "true", false);
			else if (!item.Selectable) {
				writer.AddAttribute ("href", "#", false);
				writer.AddStyleAttribute ("cursor", "text");
			} else if (item.NavigateUrl != String.Empty) {
				string target = item.Target != String.Empty ? item.Target : owner.Target;
				string navUrl = owner.ResolveClientUrl (item.NavigateUrl);
				writer.AddAttribute ("href", navUrl);
				if (target != String.Empty)
					writer.AddAttribute ("target", target);
			} else
				writer.AddAttribute ("href", GetClientEvent (owner, item));
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:16,代碼來源:BaseMenuRenderer.cs

示例13: BaseMenuRenderer

		public BaseMenuRenderer (Menu owner)
		{
			if (owner == null)
				throw new ArgumentNullException ("owner");

			this.Owner = owner;
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:7,代碼來源:BaseMenuRenderer.cs

示例14: Page_Load

 protected void Page_Load(object sender, EventArgs e)
 {
     Menu navbar = new Menu(nav);
 }
開發者ID:ramonramirezz,項目名稱:TechStore,代碼行數:4,代碼來源:contacto.aspx.cs

示例15: SetearOpcionesGeneral

 private void SetearOpcionesGeneral(Menu menuPrincipal)
 {
     // Remover los items que no son accesibles por el usuario
     menuPrincipal.Items.Remove(menuPrincipal.FindItem("Empleado"));
     menuPrincipal.Items.Remove(menuPrincipal.FindItem("Comision"));
 }
開發者ID:nMoschen,項目名稱:NET_TP2,代碼行數:6,代碼來源:Home.aspx.cs


注:本文中的System.Web.UI.WebControls.Menu類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。