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

Display patial from different controller and post back to controller

1 Answer 96 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Kahl
Top achievements
Rank 1
Kahl asked on 23 Mar 2017, 08:53 AM

I have tabstrip that is displaying a partial from a different controller/view area, but I cant get the post of the partial in the tabstrip to post back to the different controller

 

the View that the tab is in.

~/Areas/Secure/Views/Company/companyStaff.cshtml

display a view assocated to a different controller

tabstrip.Add().Text("Create Contact")
                  .Selected(false)
                  .Content(Html.Partial("~/Areas/Secure/Views/Contact/_ContactManagement.cshtml",  new WebSite.Library.Models.Contact() , new ViewDataDictionary { { "Id", "0" } }).ToHtmlString());

 

How can I get the partial in the tab to post back to its own controller post method

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivan Danchev
Telerik team
answered on 27 Mar 2017, 10:49 AM
Hello Kahl,

I tested the described scenario and at my end the form in a partial view loaded in a TabStrip tab was posted to the specified controller:

Partial View:
@using (Html.BeginForm("MyAction", "Default1", FormMethod.Post))
{

Controller:
[HttpPost]
public ActionResult MyAction()
{

Do you have the HttpPost attribute set to your action?

Regards,
Ivan Danchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
TabStrip
Asked by
Kahl
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or