I have a "a" tag in another view and another driver that is not from the client driver
<div class="col-lg-4 col-md-6">
<a asp-action="Cliente" asp-controller="Cliente" class="">@item.Razonsocial</a>
</div>
I thought of the ASP Helpers to pass something to it as a parameter.
How do I pass as parameter the @ item.name from the X view to the client driver?
public async Task<IActionResult> Cliente(string nit)
{
if(nit == null)
{
ViewBag.Message = "Debe ingresar Nit o Nombre del cliente";
return View("Index");
}
var a = await _clienteService.GetClientesAsync(nit);
if (!a.Any())
{
ViewBag.Message = "El cliente no existe o no pertenece a su zona de distribución";
return View("Index");
}
return View("Index", a);
}
This is the controller that receives it; if it receives a list, in the view it shows me some data, if it receives a single data, it shows me the client's data, that's what I want when I pass it the name