I've this scenario:
Site.Master
...
<%= Html.TextBox("ricerca") %>
<img src="" alt ="" id="search" />
...
<script type="text/javascript">
$(function() {
$('#search').click(function() {
var valueSearch = $('#ricerca').val();
Search(valueSearch);
});
});
function Search(valueSearch) {
$.ajax({
type: "POST",
url: "/Home/Search",
data: "value=" + valueSearch
});
}
HomeController
[HttpPost]
public ActionResult Search(string value)
{
//...logic search
return View();
}
When i click on image called correctly the Search action, but after "Return View();" don't load the Search view (positioned in the folder Home)
Why don't show?