Hi there,
I guess you're using SiteMapDataSource as a datasource to your menu.
SiteMapDataSource sets the databindings of the menu by default as follows:
1. the TextFiled is bound by default to the Title attribute which is coming from the Web.sitemap file
2. the NavigationUrl is bound to the url attribute coming from Web.sitemap as well.
if the menu nodes were bound to a specific field (or property) in the data source, then the menu items will be rendered as html links (<a href='the url coming from the web.sitemap'>Title</a>)
links are handled by the browser and doesn't post the page back to the server, rather browsers make a get request to the specified link. in this case you will never get to your MenuItemClick event handler.
However, in case the menu's "Navigation Url Field" was not bound to any property, then the menu items will be rendered in very similar way a "Link Button" does, and will post back to the same page and reach your event handler.
try adding the following code inside the <asp:Menu> tags:
<DataBindings>
<asp:MenuItemBinding DataMember="SiteMapNode" TextField="Title" />
</DataBindings>
and in your MenuItemClick event handler add the following code:
Response.Write("You clicked on " + e.Item.Text);
and you'll see how it works perfectly!
Cheers,
Eyad.
<%= Eyad.Salamin %><aspForums:DontForget>Don't forget to click on Mark as answer on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
</aspForums:DontForget>