[RESOLVED] Actionlink not working.
Hi All,
I'm using MVC3 with Razor.
In one of my views I have:
Code:
<div style="width: 100em; float: left">
<button id="saveButton" name="submitButton" value="save" type="submit">
Save</button>
@Html.ActionLink("Cancel", "Edit", "ComputerBreakDownSection", new { sectionID = Model.SectionID, policyZoneId = Model.PolicyZoneID, fred = 1}, new { id = "cancelLink" })
</div>
and in my controller I have:
Code:
public ActionResult Edit(int sectionID, int policyZoneId)
{
ComputerBreakDownSectionViewModel viewModel = _gridService.GetComputerBreakDownSectionViewModel(policyZoneId, sectionID);
return View(viewModel);
}
[HttpPost]
public ActionResult Edit(int sectionID, int policyZoneId, int fred)
{ ........
when I press my save button on the form I am expecting the controller to enter my HttpPost Edit ActionResult. However neither of the Edit actions in my controller are triggered on the press of the button. Am I missing something from the ActionLink
Re: [RESOLVED] Actionlink not working.
Hi,
This isn't exactly the same code however, it does use razor for that version of the project. I used that project to help me with a non-razor version for school.