I use AttributeRouting to set specific route for my ActionResult. I got an 404 page not found when I have this configuration:
[GET("Tender/SubmitBid/{id}/{bidId}")]
public ActionResult SubmitBid(string id, string bidId)
{
...
return View(model);
}
@using ("SubmitBid", "Tender", new { id = Model.TenderId, bidId = Model.BidId }, FormMethod.Post, new { enctype = "multipart/form-data" }))
{
...
<button type="submit">Save</button>
}
// 404 not found
[HttpPost]
public ActionResult SubmitBid(BidViewModel model)
{
...
}
I installed a url sniffer to see the url trigger the 404 page not found and I got this: http.../Tender/SubmitBid/1/0
It supposed to be working... but I have to remove the latest parameters to reach the ActionResult and I don't know why.
Thank you for your help,
Karine
Edit If I remove the attribute [GET("Tender/SubmitBid/{id}/{bidId}")] the page is accessible for the POST request. But the url is like http...//Tender/SubmitBid/1?bidId=0
GETorPOST? - Henk MollemaBidViewModelclass? - Henk Mollema{controller}/{action}/{id}) - Henk Mollema