本文整理汇总了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;
}
示例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();
}
}
示例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();
//}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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 ());
}
示例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);
}
示例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;
}
示例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));
}
示例13: BaseMenuRenderer
public BaseMenuRenderer (Menu owner)
{
if (owner == null)
throw new ArgumentNullException ("owner");
this.Owner = owner;
}
示例14: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
Menu navbar = new Menu(nav);
}
示例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"));
}