Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > General Discussions > MVC Menu: Capture selected item in Controller
Telerik MVC Extensions are no longer supported (see this page for reference). In case you have inquiries about Kendo UI Complete for ASP.NET MVC, post them in the pertinent Kendo UI forums.

Not answered MVC Menu: Capture selected item in Controller

Feed from this thread
  • NK avatar

    Posted on Jun 5, 2012 (permalink)

    Would please offer an example in vb.net of how to capture the selected item for mvc menu in an existing controller. I've seen the examples for client side capture but not sure how to get this to my server side/controller. Thanks

  • Dimo Dimo admin's avatar

    Posted on Jun 6, 2012 (permalink)

    Hi NK,

    The Menu has no built-in mechanism to submit data to the server, so you need to do this manually. Add a form with a hidden field to the page and populate the field in the OnSelect event with any information that you will need.

    Kind regards,
    Dimo
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.

  • NK avatar

    Posted on Jun 6, 2012 (permalink)

    Thanks for your answer.  However, i realized what i need to do is just route to an action in controller:

                 @(Html.Telerik().Menu() _
                    .Name("ToolsMenu") _
                    .Items(Function(items)
                                   items.Add().Text("Export to CSV").Action("ExportToCSV", "Home")
                           End Function) _
                     .Render()

    Is this the correct syntax for adding an action link to menu item in VB.NET. I get a syntax error: "Expression does not produce a value"

    Thank you.

  • Dimo Dimo admin's avatar

    Posted on Jun 7, 2012 (permalink)

    Hi Nik,

    Using an Action for the item is a viable approach as well.

    However, you can't use @( ) code blocks with a Render() statement.

    http://forums.asp.net/t/1694834.aspx/1

    Regards,
    Dimo
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Telerik MVC Extensions (superseded) > General Discussions > MVC Menu: Capture selected item in Controller