</div>
</div>
<div class="grid--cell mb0 mt4">
<a href="/questions/19392212/how-to-use-jquery-or-ajax-to-update-razor-partial-view-in-c-asp-net-for-a-mvc-p" dir="ltr">How to use jquery or ajax to update razor partial view in c#/asp.net for a MVC project</a>
<span class="question-originals-answer-count">
(3 answers)
</span>
</div>
<div class="grid--cell mb0 mt8">Closed <span title="2016-08-19 00:29:52Z" class="relativetime">3 years ago</span>.</div>
</div>
</aside>
I have a a partial view "_search" that display a list of data I added a textbox for search and a link search
when I click on the link I get an error page undefined. how can I execute the search method and display th same partial view in my search method I return json
return Json(
{
Data = base.RenderPartialView("_search", model),
}, JsonRequestBehavior.AllowGet);
search view
I changed <a>
with a button
<script type="text/javascript">
document.getElementById("myButton").onclick = function () {
location.href = '@Url.Action("Search")'
};
</script>
<button id="myButton" >search</button>
</div>