I'm using Ajax.BeginForm
helper. It works well but I have a small issue.
Here is the code:
<div class="row" id="pdiv">
@using (Ajax.BeginForm("SomeAction","SomeController",new AjaxOptions{UpdateTargetId="pdiv"}))
{
.....
}
</div>
I've set the UpdateTargetId to "pid".
So initially rendered HTML looks like:
<div class="row" id="pdiv">
<form action="/SomeController/SomeAction" data-ajax="true" data-ajax-mode="replace" data-ajax-update="#pdiv" id="form0" method="post">
....
Now When I do a submit it places the entire pid div inside the pid. i.e.
<div class="row" id="pdiv">
<div class="row" id="pdiv">
<form action="/SomeController/SomeAction" data-ajax="true" data-ajax-mode="replace" data-ajax-update="#pdiv" id="form0" method="post">
.....
}
I tried setting the Ajax Option InsertionMode= InsertionMode.Replace
But no success. Is there anyway by which i can complete replace the "pdiv" with the newly obtained content?