[cshtml]
<form id="Form1" asp-area="filter" asp-controller="Home" asp-action="Index" asp-route-model="@Model">
<div class="control">
<ej-dialog id="filterDialog" title="Filter Trades List"
enable-modal="true"
is-responsive="true" close="onDialogClose" show-on-init="false">
<e-content-template>
<table>
<tr>
<td>
<p class="top">Please select your filters</p>
</td>
</tr>
<tr>
<td>
<input asp-for="@Model.ShowAll" id="showall" name="showall" /> Show All<br />
<span asp-validation-for="@Model.ShowAll" class="text-danger small"></span>
</td>
</tr>
<tr>
<td>
<input asp-for="@Model.Offers" id="offer" /> Show Offers<br />
<span asp-validation-for="@Model.Offers" class="text-danger small"></span>
</td>
</tr>
<tr>
<td>
<input asp-for="@Model.Requests" id="request" /> Show Requests<br />
<span asp-validation-for="@Model.Requests" class="text-danger small"></span>
</td>
</tr>
<tr>
<td align="center">
<br />
<button id="btnSubmit" class="btn btn-primary btn-outline-rounded"
style="color:#fff;"
onclick="submitForm()">
Filter
</button>
</td>
</tr>
</table>
</e-content-template>
</ej-dialog>
</div>
</form> |
[script]
function submitForm() {
document.getElementById("Form1").submit();
var value = $("#showall").val();
var value1 = $("#offer").val();
var value2 = $("#request").val();
$.ajax({
url: "Home/Filter",
data: { showall: value, offer: value1, request: value2 },
type: 'POST',
dataType: "json",
success: function (result) {
}
});
} |
[cs]
public IActionResult Filter(string showall, string offer, string request)
{
return View();
} |