How to add bar separator to Menu items?

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?
 
M

Manish

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top