I have a problem in ajax and ASP.NET MVC. When I click on button submit, I redirect to a partial page. I don't need redirect - I need replace div
Controller
public PartialViewResult ajaxtest(string prname)
{
var aj = db.acount.Where(p => p.name.StartsWith(prname));
return PartialView("_ajTest", aj.ToList());
}
View
@using (Ajax.BeginForm("ajaxtest", "Default1", new AjaxOptions () {
HttpMethod = "POST",
UpdateTargetId = "othmanN",
InsertionMode = InsertionMode.Replace
}))
{
<label>Product Name :</label>
@Html.TextBox("prname")
<input type="submit" name="name" value="search" />
}
<div id="othmanN">
//here table
</div>