|
Rank: Member Groups: Member
Joined: 7/1/2007 Posts: 17
|
I have tried to capture itemclick event from slide menu items, and I found that the server event is not raised if there is a URL assigned to the menu item. Is it by designed?
I have creating a site.master file to control navigation but I need to capture the item click event from the slide menu when user choose a menu item as well as fowarding to the URL specified.
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 5/30/2007 Posts: 42
|
I had also this problem i fixed it when i created a server event for the menu in the Page Load this.SlideMenu.ItemClick += new AspxLab.WebControls.MenuItemClickEventHandler(this.SlideMenu_ItemClick); and when creating the menu list set the option XX.RaisesServerEvent = EO.Web.NullableBool.True;
Patrick Beverloo OfficeSpecialisten www.OfficeSpecialisten.nl
|
|
Rank: Member Groups: Member
Joined: 7/1/2007 Posts: 17
|
Thanks for the suggestion.
Can you show me how to add the server event in VB.NET?
I know how to set the RaisesSeverEvent.
|
|
Rank: Advanced Member Groups: Member
Joined: 5/30/2007 Posts: 42
|
Go to Design mode, right click on the slidemenu control and select properties. click on the orange flash. Here double click on ItemClick. VS will create a event for you. Or create it with this code: Protected Sub SlideMenu1_ItemClick(ByVal sender As Object, ByVal e As EO.Web.NavigationItemEventArgs) Handles SlideMenu1.ItemClick
End Sub
Patrick Beverloo OfficeSpecialisten www.OfficeSpecialisten.nl
|
|
Rank: Member Groups: Member
Joined: 7/1/2007 Posts: 17
|
That is exactly what I have done.
As long as there is a URL attached to the menu item. The itemclick event will never fired.
As soon as I remove the URL, then it work.
|
|
Rank: Advanced Member Groups: Member
Joined: 5/30/2007 Posts: 42
|
Sorry, I dont know how i can create a event handle in the page_load event in vb.net. If you find this part it will work. just create the handle on page_load and let it fire alway on a page load. I hope you wil find it. In C# I know a lot but VB in not my strong side. It is my code in C# maby you can find a translator for this: protected override void OnInit(EventArgs e) { this.smCategoryMenu.ItemClick += new AspxLab.WebControls.MenuItemClickEventHandler(this.Menu1_ItemClick); base.OnInit(e); }
Patrick Beverloo OfficeSpecialisten www.OfficeSpecialisten.nl
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hey, Patrick, thanks for your help. Really appreciate. Tommy, actually this is by designed. NavigateUrl property will override the Item click event if you set it. Because if you set NavigateUrl to other pages, it does not make too much sense to still post back to current page into ItemClick event handler, right? So, mostly, you can either use NavigateUrl or ItemClick event. Or, you can in your ItemClick event, use Redirect to redirect to other pages.
Thanks.
|
|