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

How to submit an Ajax.Beginform on menu item selected...

2 Answers 98 Views
Menu
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael
Top achievements
Rank 1
Michael asked on 13 Jul 2011, 05:47 PM
I am using the menu like a drop down button. If the user selects an items in the list I want the Ajax form to automatically submit. Is there a way to do this?

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 14 Jul 2011, 09:31 AM
Hello Michael,

You can use Ajax.ActionLink as menu item text:

items.Add().Text("Ajax item").Text(Ajax.ActionLink(...)).Encoded(false);

Regards,
Atanas Korchev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Jason
Top achievements
Rank 1
answered on 08 Sep 2011, 05:37 PM
I have tried to use this solution, but for some reason it redirects to the link instead of calling the function via ajax.  I have included jquery.unobtrusive-ajax.min.js so that is not it.  I have tracked it down to when the scrip registrar calls:

jQuery('#Menu').tMenu();

When that is included (which is really important) then the ajax.actionlink items no longer work properly.  I am not sure what extra code gets added to the click of a link that is causing this to fail.

Please let me know if there is a solution so I can use Ajax links.  This would be VERY helpful!
Tags
Menu
Asked by
Michael
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Jason
Top achievements
Rank 1
Share this question
or