Quantcast
Channel: Optimizely Search & Navigation
Viewing all articles
Browse latest Browse all 6894

Html.BeginForm Routing In Page Type

$
0
0

Hello,

Sorry if this question has been asked before. I haven't been able to find the kind of solution I'm looking for.

I've hardcoded a MVC form that uses an HTTP POST method to communicate with an API to an external database within a new Page Type. 

@using (Html.BeginForm([actionName], [controllerName], FormMethod.Post, new { role = "form" }))
{
@Html.AntiForgeryToken()

//Form

}

Traditionally in MVC I'd use Html.BeginForm to POST the submitted form values to the database. Unfortunately because of the way routing is set up in Episerver I'm not sure how to successfully submit the form without running into the error HTTP Error 404.0 - Not Found after clicking submit. Is there a straightforward way to set up the routing for the form within Episerver to successfully submit POST method forms?

Much appreciated.


Viewing all articles
Browse latest Browse all 6894

Trending Articles