How to add bar separator to Menu items?

  • Thread starter Thread starter gnewsgroup
  • Start date Start date
G

gnewsgroup

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?
 
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
 
Back
Top