views:

41

answers:

3

Hi, In my mvc web application, I am using telerik tab strip for different tabs. Now I want that for each tab , I can call different action method of controller. How Can I do that?

A: 

Hi,

I want to use tab on the view, Requirement are like that: 1. When I click on 1'st tab , it should call action method named "action1()". 2. When I click on 2 'nd tab, it should call action method names "action2()".

Is this possible?

I want to do that because in each action method I have different functionality.

aayushi soni
Edit your question instead of posting a new answer to clarify what you want to do.
Bertrand Marron
A: 

If you need to post the data only the current tab, you can create a form on each tab, each with its action. If need to post data from the entire page you can manipulate the action of form with javascript.

A: 

I am still not sure what your requirement is but I will tell what the tabstrip can do.

If you want the tabstrip to invoke an action method after clicking a tab use the Action method of the fluent API to specify it:

tabs.Add().Text("Home").Action("Index" /* action */, "Home" /* controller */);

If you want to specify an action whose output (view) is loaded in the tab use the LoadContentFrom method:

tabs.Add().Text("Home").LoadContentFrom("Index" /* action */, "Home" /* controller */);

You can check the ajax load on demand demo for a live example of the second.

korchev