This is a migrated thread and some comments may be shown as answers.
How to specify Action and controller for menitem clicked
1 Answer 26 Views
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:45 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;                    
                    }));        
            })
        )

1 Answer, 1 is accepted

Sort by
0
Jack
Top achievements
Rank 1
answered on 09 Sep 2011, 09:29 PM
Hi, u can pass Item.Url = Url.Action("action","controller") if fixed name.. i opened a thread asking one issue on top..
Tags
Menu
Asked by
Naunihal
Top achievements
Rank 1
Answers by
Jack
Top achievements
Rank 1
Share this question
or