I'm using Url.Action to pass some paramenters to a method, like this
//Sending data
<a href="@Url.Action("BorrarMensaje", "Supplier", new { idMsg = item.IDMensaje, idMsgUsr = item.IDMensajeUsuario, idImg = item.IDImagen, idsArchs = item.IDArchivos })" class="btn btn-danger">Sí</a>
//Method
public ActionResult BorrarMensaje(int idMsg, int idMsgUsr, int idImg, List<int> idsArchs)
{
tblMensaje tblMensaje = db.tblMensaje.Find(idMsg);
tblMensajesUsuario tblMensajesUsuario = db.tblMensajesUsuario.Find(idMsgUsr);
tblImagenAdj tblImagenAdj = db.tblImagenAdj.Find(idImg);
foreach (var id in idsArchs)
{
tblArchivoAdj tblArchivoAdj = db.tblArchivoAdj.Find(id);
db.tblArchivoAdj.Remove(tblArchivoAdj);
}
//Some more code...
The values of idMsg, idMsgUsr, idImg are sent as arguments, but idsArch just doesn´t get the value of IDArchivos, when I view the count property it shows 0, (both idsArch and IDArchivos are of type List), I don't know why it isn't working, is there any alternative to do this? Thanks beforehand
For alternatives; you could write it as a Form and fields are hidden.
No changes in controller.