Help, event not triggered

Discussion in 'ASP .Net' started by Jeff, Jul 18, 2006.

  1. Jeff

    Jeff Guest

    Hey

    asp.net 2.0

    I'm having a menu on my webpage. In this menu I've placed some code at the
    ItemClick event:
    protected void mnuHeader_MenuItemClick(object sender, MenuEventArgs e)
    {
    switch (e.Item.Value)
    {
    case "test a":
    SiteMapDataSource dataSource = (SiteMapDataSource)
    lvSidebar.FindControl("SiteMapDataSource1");
    return;
    }
    }


    I set a breakpoint on this line "switch (e.Item.Value)", but while running
    the applcation the brakpoint isn't triggered. So I wonder what I'm doing
    wrong here?

    Just in case, here is my menu:
    <asp:panel ID="Panel1" runat="server" Height="50px" Style="z-index: 100;
    left: 10px; position: absolute; top: 91px" Width="918px">
    <asp:LoginView ID="lvMenu" runat="server">
    <AnonymousTemplate>
    &nbsp;
    </AnonymousTemplate>
    <LoggedInTemplate>
    <asp:Menu ID="mnuHeader" runat="server" BackColor="#F7F6F3"
    DataSourceID="SiteMapDataSource1"
    DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="0.8em"
    ForeColor="#7C6F57"
    MaximumDynamicDisplayLevels="0" Orientation="Horizontal"
    StaticDisplayLevels="2"
    StaticSubMenuIndent="10px" Style="z-index: 100; left: 0px;
    position: absolute;
    top: 0px" OnMenuItemClick="mnuHeader_MenuItemClick">
    <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px"
    />
    <DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
    <DynamicMenuStyle BackColor="#F7F6F3" />
    <StaticSelectedStyle BackColor="#5D7B9D" />
    <DynamicSelectedStyle BackColor="#5D7B9D" />
    <DynamicMenuItemStyle HorizontalPadding="5px"
    VerticalPadding="2px" />
    <StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
    </asp:Menu>
    <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
    SiteMapProvider="LoggedIn" />
    </LoggedInTemplate>
    </asp:LoginView>
    </asp:panel>
     
    Jeff, Jul 18, 2006
    #1
    1. Advertising

  2. Jeff

    Jeff Guest

    CASE SOLVED

    Setting the MenuItem DataBindings solved this problem


    "Jeff" <> wrote in message
    news:eggA$...
    > Hey
    >
    > asp.net 2.0
    >
    > I'm having a menu on my webpage. In this menu I've placed some code at the
    > ItemClick event:
    > protected void mnuHeader_MenuItemClick(object sender, MenuEventArgs e)
    > {
    > switch (e.Item.Value)
    > {
    > case "test a":
    > SiteMapDataSource dataSource = (SiteMapDataSource)
    > lvSidebar.FindControl("SiteMapDataSource1");
    > return;
    > }
    > }
    >
    >
    > I set a breakpoint on this line "switch (e.Item.Value)", but while running
    > the applcation the brakpoint isn't triggered. So I wonder what I'm doing
    > wrong here?
    >
    > Just in case, here is my menu:
    > <asp:panel ID="Panel1" runat="server" Height="50px" Style="z-index: 100;
    > left: 10px; position: absolute; top: 91px" Width="918px">
    > <asp:LoginView ID="lvMenu" runat="server">
    > <AnonymousTemplate>
    > &nbsp;
    > </AnonymousTemplate>
    > <LoggedInTemplate>
    > <asp:Menu ID="mnuHeader" runat="server" BackColor="#F7F6F3"
    > DataSourceID="SiteMapDataSource1"
    > DynamicHorizontalOffset="2" Font-Names="Verdana"
    > Font-Size="0.8em" ForeColor="#7C6F57"
    > MaximumDynamicDisplayLevels="0" Orientation="Horizontal"
    > StaticDisplayLevels="2"
    > StaticSubMenuIndent="10px" Style="z-index: 100; left: 0px;
    > position: absolute;
    > top: 0px" OnMenuItemClick="mnuHeader_MenuItemClick">
    > <StaticMenuItemStyle HorizontalPadding="5px"
    > VerticalPadding="2px" />
    > <DynamicHoverStyle BackColor="#7C6F57" ForeColor="White" />
    > <DynamicMenuStyle BackColor="#F7F6F3" />
    > <StaticSelectedStyle BackColor="#5D7B9D" />
    > <DynamicSelectedStyle BackColor="#5D7B9D" />
    > <DynamicMenuItemStyle HorizontalPadding="5px"
    > VerticalPadding="2px" />
    > <StaticHoverStyle BackColor="#7C6F57" ForeColor="White" />
    > </asp:Menu>
    > <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server"
    > SiteMapProvider="LoggedIn" />
    > </LoggedInTemplate>
    > </asp:LoginView>
    > </asp:panel>
    >
    >
     
    Jeff, Jul 18, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve Pan
    Replies:
    1
    Views:
    411
    Fred W
    Nov 6, 2003
  2. John Sturgeon

    DataGrid SortCommand event not triggered

    John Sturgeon, Nov 26, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    583
    John Sturgeon
    Dec 2, 2003
  3. click event not triggered

    , Feb 28, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    334
  4. Replies:
    4
    Views:
    501
  5. Sjaakie
    Replies:
    1
    Views:
    424
    Manalishi
    Aug 6, 2006
Loading...

Share This Page