Hello,
I'm developing an application with ASP .NET MVC and using the EPPlus API for XLS export.
In the View of an equipment report I have two @Html.DropDownList with Equipment Type and Status respectively.
To display the report I am working with a Input
of type Submit
named Filter , which sends Id both Type and Status for the query in the database through ActionResult
of the view itself.
How could I use these same% 2 of% to send, from% Export , the parameters to another DropDownList
of my Input
who will do the same search and will return an XLSX?
Follow the cshtml code snippet:
<div class="ibox-content">
<div class="row">
@using (Html.BeginForm())
{
<div class="col-sm-5 m-b-xs">
@Html.DropDownList("TipoEquipamento", null, htmlAttributes: new { @class = "input-sm form-control input-s-sm inline" })
</div>
<div class="col-sm-5 m-b-xs">
@Html.DropDownList("StatusEquipamento", null, htmlAttributes: new { @class = "input-sm form-control input-s-sm inline" })
</div>
<div class="col-sm-3">
<div class="input-group">
<input type="submit" value="Filtrar" class="btn btn-primary" />
</div>
</div>
}
@using (Html.BeginForm("ExportarDados", "Signv", FormMethod.Get))
{
<div class="col-sm-3">
<div class="input-group">
<input type="submit" value="Exportar" class="btn btn-primary" />
</div>
</div>
}
</div>
Following the structure of the actions of my controller:
[HttpPost]
public ActionResult Index(int TipoEquipamento, int StatusEquipamento)
{
.... Código da Action...
}
public ActionResult ExportarDados(int TipoEquipamento, int StatusEquipamento)
{
.... Código da Action...
}