asp:Menu - Adding an OnClientClick Event

G

Guest

I am trying to add an OnClientClick event to links in an asp:Menu.

I tried using a StaticItemTemplate to bind the MenuItem data to a LinkButton
with an OnClientClick attribute. This works fine to a point. This does get an
OnClientClick event onto the menu items but it causes the codebehind
ItemCommand for the Menu to become unwired. It seems that when my Menu is
rendered to html the link buttons in the menu have two <a> tags rendered one
inside another. The outer <a> tag has the OnClientClick event but the call to
__DoPostBack is missing its EventArgument. The inner <a> tag has the
EventArgument.

Any one know of another way to add an OnClientClick attribute to a menuItem
in an asp:Menu control?

-J
 

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

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top