csefaruk
csefaruk

Reputation: 191

call current controller action within button click from partial view in MVC3 view razor view engine

I have a view with including partial view (Partial view from different controller that call @{ Html.RenderAction("DebitHeadConfigure", "HeadDisplayConfigure");}) now i need a action against Button click which button come from partial view

Note : Currently if i use submit type button then it call my main controller action

Upvotes: 1

Views: 1254

Answers (1)

user338195
user338195

Reputation:

Problem isn't in your button, but in the form that you are submitting. Make sure that you specify action and controller in a form within your partial view.

For example:

@using (Html.BeginForm("ActionToCall", "ControllerContainingAction", FormMethod.POST)) {
     <p>
         My Form
     </p>
}

References:

Upvotes: 3

Related Questions