update replace menu
This commit is contained in:
parent
884183a2ce
commit
536447fd36
10 changed files with 35 additions and 10 deletions
|
@ -2,6 +2,6 @@
|
|||
<asp:SiteMapDataSource ID="siteMapSource" runat="server" ShowStartingNode="False" />
|
||||
|
||||
<asp:Menu ID="topMenu" runat="server" DataSourceID="siteMapSource"
|
||||
CssSelectorClass="TopMenu" Orientation="Horizontal"
|
||||
CssSelectorClass="TopMenu" Orientation="Horizontal"
|
||||
EnableViewState="False" onmenuitemdatabound="topMenu_MenuItemDataBound">
|
||||
</asp:Menu>
|
|
@ -41,6 +41,12 @@ namespace WebsitePanel.Portal.SkinControls
|
|||
{
|
||||
public partial class TopMenu : System.Web.UI.UserControl
|
||||
{
|
||||
public string Align
|
||||
{
|
||||
get { return ViewState["Align"].ToString(); }
|
||||
set { ViewState["Align"] = value; }
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
@ -48,7 +54,15 @@ namespace WebsitePanel.Portal.SkinControls
|
|||
|
||||
protected void topMenu_MenuItemDataBound(object sender, MenuEventArgs e)
|
||||
{
|
||||
string target = ((SiteMapNode)e.Item.DataItem)["target"];
|
||||
var node = ((SiteMapNode)e.Item.DataItem);
|
||||
|
||||
if (node["align"] == Align)
|
||||
{
|
||||
topMenu.Items.Remove(e.Item);
|
||||
return;
|
||||
}
|
||||
|
||||
string target = node["target"];
|
||||
|
||||
if(!String.IsNullOrEmpty(target))
|
||||
e.Item.Target = target;
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.3074
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue