How to add bar separator to Menu items?

Discussion in 'ASP .Net' started by gnewsgroup, May 15, 2008.

  1. gnewsgroup

    gnewsgroup Guest

    I have a Menu control which is data bound to an xml document. I would
    like to add a separator ("|") between two menu items.

    I googled and found this: http://forums.asp.net/p/942408/1129699.aspx

    So, I declared

    OnDataBound="Menu1_DataBound"

    in my menu declaration and implemented the DataBound event handler as
    shown in the asp.net forum.

    But, when check it out from my browser, I get this exception:

    CS0123: No overload for 'Menu1_DataBound' matches delegate
    'System.EventHandler'

    How come? Thank you?
     
    gnewsgroup, May 15, 2008
    #1
    1. Advertising

  2. gnewsgroup

    Manish Guest

    Hi,

    The event name is MenuItemDataBound but that does not seems to be working.
    However, if I perform the same thing on the menuClick event then it works
    fine.

    Protected Sub Menu1_MenuItemDataBound(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.MenuEventArgs) Handles Menu1.MenuItemDataBound
    End Sub

    Protected Sub Menu1_MenuItemClick(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.MenuEventArgs) Handles Menu1.MenuItemClick
    Response.Write(e.Item.Text + "</br>")
    e.Item.ImageUrl = "aspnetdemos_icon_start.gif"
    e.Item.SeparatorImageUrl = "bar_black_bg.gif"
    End Sub

    Regards,
    Manish
    www.componentone.com

    "gnewsgroup" wrote:

    > I have a Menu control which is data bound to an xml document. I would
    > like to add a separator ("|") between two menu items.
    >
    > I googled and found this: http://forums.asp.net/p/942408/1129699.aspx
    >
    > So, I declared
    >
    > OnDataBound="Menu1_DataBound"
    >
    > in my menu declaration and implemented the DataBound event handler as
    > shown in the asp.net forum.
    >
    > But, when check it out from my browser, I get this exception:
    >
    > CS0123: No overload for 'Menu1_DataBound' matches delegate
    > 'System.EventHandler'
    >
    > How come? Thank you?
    >
    >
     
    Manish, May 16, 2008
    #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. Matt
    Replies:
    0
    Views:
    3,604
  2. John Hann
    Replies:
    0
    Views:
    6,170
    John Hann
    Aug 21, 2004
  3. Matt
    Replies:
    9
    Views:
    71,254
  4. Larry Bud
    Replies:
    13
    Views:
    7,815
    Larry Bud
    Jan 7, 2008
  5. Matt
    Replies:
    9
    Views:
    648
    kaeli
    Aug 23, 2004
Loading...

Share This Page