good day. I am currently working with .net and I have problem I want to send information to a method of a controller by means of a @ Html.ActionLink , this method asks me for two values which are the LevelId that I have no problem in passing it and I have to pass the selection you have in @ Html.DropDownList the problem is that I could not know how to pass the information. I tried to put an id @ Html.DropDownList but it does not work since the @ Html.ActionLink can not find it.
This is the @ Html.DropDownList
<div class="container">
<div class="form-group">
<h3>Anno lectivo</h3>
<div class="col-md-10">
@Html.DropDownList("AnnoLectivoId", null, htmlAttributes: new { @class = "form-control" , @id = "AnnoLectivoId" })
</div>
</div>
The table shows an information and for each row there is a @ Html.ActionLink that allows to direct this information to a method in a controller, I want to attach the information of the @ Html.DropDownList that would be the id of what is selected.
<table class="table table-striped">
<tr>
<th>
@Html.DisplayNameFor(model => model.NameLevel)
</th>
<th>
@Html.DisplayNameFor(model => model.DescriptionLevel)
</th>
<th>
Acciones
</th>
</tr>
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.NameLevel)
</td>
<td>
@Html.DisplayFor(modelItem => item.DescriptionLevel)
</td>
<td>
@Html.ActionLink("Detalle", "ChangeStatus", "Enroll_Student", new { id = item.LevelId }, new { @class = "btn btn-info" })
</td>
</tr>
}