I have a strange problem where unobtrusive checks inside a partial view (which is rendered by Ajax.ActionLink) do not work.
This is a partial view:
@model MyWeb.Models.PersonSkill @using (Ajax.BeginForm("EditSkill", null, new AjaxOptions { UpdateTargetId = "skills" }, new { id = "EditSkillForm" })) { @Html.HiddenFor(model => model.Id) <div class="editor-label"> @Html.LabelFor(model => model.Name) </div> <div class="editor-field"> @Html.EditorFor(model => model.Name) @Html.ValidationMessageFor(model => model.Name) </div> <div class="editor-label"> @Html.LabelFor(model => model.YearsOfExperience) </div> <div class="editor-field"> @Html.EditorFor(model => model.YearsOfExperience) @Html.ValidationMessageFor(model => model.YearsOfExperience) </div> <p> <input type="submit" value="Save"/> </p> }
And this is called:
@Ajax.ActionLink("Edit", "LoadEditSkill", new { id = item.Id }, new AjaxOptions() { UpdateTargetId = "editSkillDialog" }, new { @class = "editSkill" })
The view is displayed perfectly. It sends the data back to the server, but it just doesn't check.
source share