This is a migrated thread and some comments may be shown as answers.

How to specify Controller and Action for Clicked Menu item

0 Answers 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Naunihal
Top achievements
Rank 1
Naunihal asked on 07 Sep 2011, 04:30 PM
I am using the Menu in the _Layout.cshtml. When someone clicks on a particular Menu(Top Level) or MenuItem(submenu/dropdownmenu) i want certain Action on a given controller be called.
How can i specify that ?

  @(Html.Telerik().Menu()        
            .Name("Menu")
            .BindTo(Model, mappings =>         
            {            
                mappings.For<Accounts.MainMenu>(binding => binding                    
                    .ItemDataBound((item, mainMenu) =>                    
                    {
                        item.Text = mainMenu.MenuName;
                        //I would like to specify something like this
                        // item.Controller ="Controller Name"
                        // Item.Action = "Name of Action"
                     })
                    .Children(mainMenu => mainMenu.ChildMenus));            
                mappings.For<Accounts.ChildMenu>(binding => binding                    
                    .ItemDataBound((item, childMenu) =>                    
                    {
                        item.Text = childMenu.MenuName;                    
                    }));        
            })
        )
Tags
Grid
Asked by
Naunihal
Top achievements
Rank 1
Share this question
or