Good Night!
I'm working on a Bed Management project.
In a given View, I am displaying the Registered Nurses, and for filtering purposes , a field where you can search for the name of the Department to which the ward ( s) belongs.
As pictured below:
Forthat,I'musingtheajaxHelperAjax.BeginForm
toreturnaPartialViewandpopulatethetable.TheproblemisthatI'mgettingaseparateviewwithonlythedata.Ialreadyresearchedhereonthesite,somepeoplehadthesameproblemandincludedUnobtrusivein_Layout,butIalreadydidthat.Ihavecheckedeverythingseveraltimes,andIcannotidentifywhatishappening.
- Web.configisalreadysettoUnobtrusiveforTrue
- I'vealreadyincludedthepackagevalidate.Unobtrusive
- AsDefault_LayoutdoesnotloadUnobtrusive,Ialreadydidthisfix.
- MycontrollerhasActionPartialViewResult
InNursingControllerIhave:
[HttpPost][ValidateAntiForgeryToken]publicPartialViewResultIndexDep(stringpesquisa){returnPartialView((_enfermariaAppService.ObterPeloNomeDoDepartamento(pesquisa)));}
IntheIndex(theimageabove)Ihavethefollowingcode:
//AjaxOptions@{varajaxOpts=newAjaxOptions{UpdateTargetId="tbBody",
HttpMethod = "Post",
};
}
//Formulário
@using (Ajax.BeginForm("IndexDep", ajaxOpts))
{
@Html.AntiForgeryToken()
<div class="form-inline">
@Html.TextBox("pesquisa","", new { @class = "form-control", @placeholder="Pesquise pela sigla do departamento" })
<input type="submit" value="Pesquisar" class="btn btn-info" />
</div>
}
//Tabela onde deveria ser repassado a partialView
<table class="table table-bordered">
<thead>
//Cabeçalhos...
</thead>
<tbody id="tbBody">
//Linhas...
</tbody>
From now on, I thank you immensely for all of you who can collaborate. Thanks.