[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 805
  • Last Modified:

MVC how to post to another controllers ActionResult

Say I have a view called customer with a customers controller.

On the view there is a separate form called CheckCredentials.   This is an ActionResult in the Credentials controller.

How can I post to this controller from the customers view?   So in my customers view I have

 <% using (Html.BeginForm("CheckCredentials", "Credentials", new { id = 3 }), FormMethod.Postt, null))

But if I submit this form it it is looking for the view ../Credentails/CheckCredentials/

I just want to do hit this view and do some processing and return to the customers view like

return RedirectToAction("Details", "Customers", new { Id = id });

What am I doing wrong?
1 Solution

using (Html.BeginForm("Action", "Controller", FormMethod.Post,
  new { id = "FormID" })

Open in new window

or go to basic html

<form action="/Complete/Url/Here" method="post">    

Open in new window


Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now