In a partial view, I am using MVCs Ajax.Beginform like followed:
<div id="divToReplace">
@using (Ajax.BeginForm("Action", "Controller,
new AjaxOptions
{
InsertionMode = System.Web.Mvc.Ajax.InsertionMode.Replace,
UpdateTargetId = "divToReplace"
},
new
{
id = "formID"
}))
{
...
</div>
When submitting the form, I would expect that the hole div "divToReplace" is replaced by the answer (the partial view again). But instead the inner html of the div "divToReplace" is replaced by the answer, so the beginning of the partial view looks like this:
<div id="divToReplace">
<div id="divToReplace">
...
What am I doing wrong?
update
might be a jQuery dialog or another type of control, it gets broken. – Hogfish