Having trouble linking A menu control using sitemap datasource
to MultiView and View Web Server Controls
I need CustMultview( the multiview control) to use method SetActiveView
to get ViewID called from Menucontrol using selected menuitem Title or NavigateUrl
I know I need to add
// if (!IsPostBack)
// {
I want (e.Item.text) to equal View view
so I can utilize
// CustMultview.SetActiveView(view)
// to set the View ID
or should I use
// protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
// {
// MultiView1.ActiveViewIndex = Int32.Parse(e.Item.Value);
? I not sure if I am making any sense.
all the Details are below. I would appreciate some assistance ASAP
[code-behind file- Browse2.aspx.cs]
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;
public partial class Customer_Browse2_aspx : System.Web.UI.Page
{
protected void btnleft_MenuItemClick(Object sender, MenuEventArgs e)
{
// here is the problem!!
}
}
[Sitmap file]
<?xml version="1.0" encoding="utf-8" ?>
<siteMap >
<siteMapNode title="Home" url="Customer/Cust_home.aspx">
<siteMapNode title="Consumables" url="Customer/browse2.aspx?Consumables" />
<siteMapNode title="Services" url="Customer/browse2.aspx?Services" >
</siteMapNode>
<siteMapNode title="Training" url="Customer/browse2.aspx?Training" />
<siteMapNode title="Support" url="Customer/browse2.aspx?Support" >
</siteMapNode>
</siteMapNode>
</siteMap>
[menu control]
<div class="stripes" style="left: 0px; top: 10px">
</div>
<div class="btnbar">
<asp:menu id="btnleft" runat="server"
datasourceid="SiteMapDataSource1"
cssclass="btnleft"
orientation="Horizontal"
maximumdynamicdisplaylevels="0"
Target=""
skiplinktext=""
staticdisplaylevels="2" BorderColor="#999999" BorderStyle="Solid" BorderWidth="0px"
OnMenuItemClick="btnleft_MenuItemClick" >
<DynamicMenuItemStyle BorderStyle="None" />
<StaticMenuItemStyle CssClass="btnon" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" HorizontalPadding="0px" ItemSpacing="0px" />
<StaticHoverStyle CssClass="btnon" BorderStyle="Solid" BorderColor="#999999" BorderWidth="1px" />
<StaticSelectedStyle BackColor="White" />
</asp:menu>
[Multiview control]
<asp:MultiView ID="CustMultiView" runat="server" ActiveViewIndex=0>
<asp:View ID="Consumables" runat="server">
// content......
</asp:View>
<asp:View ID="Services" runat="server">
// content......
</asp:View>
<asp:View ID="Training" runat="server">
// content......
</asp:View>
<asp:View ID="Support" runat="server">
// content......
</asp:View>
</asp:MultiView>