Hello, if you programmatically change the selected menu item (as opossed to the user clicking on a menu item) on a ASP.NET 2.0 Menu control as follows: Menu Control: <asp:Menu ID="mnuActions".... Code to programmatically change the selected menu item: Dim mi As MenuItem = Me.mnuActions.FindItem("Customers") mi.Selected = True The above code will not fire the MenuItemClick event. (This was expected since the user did not click on the item) My question is, is there another event that will detect when the selected menu item was programmatically changed? Thanks Before Hand, Adiel
Hi Adiel > Code to programmatically change the selected menu item: > Dim mi As MenuItem = Me.mnuActions.FindItem("Customers") > mi.Selected = True > > The above code will not fire the MenuItemClick event. (This was > expected since the user did not click on the item) This is the expected behavior. Theres no user interaction, theres no event fireing. Do fire your event manually or do your stuff right on that place you set the item to "selected = true". > My question is, is there another event that will detect when the > selected menu item was programmatically changed? no -- Gruss, Peter Bucher Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
On 2 Jul, 14:00, adie...@hotmail.com wrote: > Hello, if you programmatically change the selected menu item (as > opossed to the user clicking on a menu item) on a ASP.NET 2.0 Menu > control as follows: > > Menu Control: > <asp:Menu ID="mnuActions".... > > Code to programmatically change the selected menu item: > Dim mi As MenuItem = Me.mnuActions.FindItem("Customers") > mi.Selected = True > > The above code will not fire the MenuItemClick event. (This was > expected since the user did not click on the item) > > My question is, is there another event that will detect when the > selected menu item was programmatically changed? > > Thanks Before Hand, > Adiel Dear Adiel Events are normally triggered by user activity on the client, by the host system external to the application, autonomous routines within the application (example page loading) or other entities (e.g. asynchronous communications) that are not under direct control of the application itself. That is the sole purpose of them. Anything that is done programatically using code written by the developer is controlled and handled by the code itself and at the time of its execution. It makes no sense to require "detection" of programmatic changes in event handlers. HTH