I have a partial view that has a create button on it however it never reaches the controller once pressed. When pressed it goes to index ie /Rebate from /Rebate/Edit/1
@model RMS.Models.RebateLine
@using (Html.BeginForm("Create","RebateLine",FormMethod.Post )) {
@Html.ValidationSummary(true)
<fieldset>
<legend>RebateLine</legend>
<div class="editor-label">
@Html.LabelFor(model => model.RebateID)
</div>
<p>
<input type="submit" value="Create" />
</p>
</fieldset>
}
Edit: Added controller logic
public class RebateLineController : BaseController
{
public ActionResult Create()
{
return View();
}
//
// POST: /RebateLine/Create
[HttpPost]
public ActionResult Create(RebateLine rebateline)
{
if (ModelState.IsValid)
{
UnitOfWork.RebateLineRepository.Insert(rebateline);
UnitOfWork.Save();
return RedirectToAction("Index");
}
return View(rebateline);
}
...
}
Additional Edit: /Rebate is what is shown after I click create and below is the call to the partial which is being called.
@{ Html.RenderPartial("_RebateLines",Model.RebateLines.FirstOrDefault() ); }
Final Edit:
I have redesigned this so partials are not need to do anything but display but if someone comes up with an answer I will attempt to go back at a later date and fix it up.
Since all your code looks good. I would take a look Glimpse this might help you track down the issue.