Click here to Skip to main content
15,881,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
@using (Html.BeginForm("Assign", "Users"))
 {
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.GroupId)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.OfficeNameAr)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.OfficeNamrEn)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.DIRCODE)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.FinanceAccountNo)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.City.CityNameAr)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.GroupId)
           @Html.HiddenFor(modelItem => item.GroupId)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.OfficeNameAr)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.OfficeNamrEn)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DIRCODE)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.FinanceAccountNo)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.City.CityNameAr)
        </td>
       
        <td>
            @Html.DropDownList("RightId", ViewBag.rights as SelectList)
        </td>
        <td>
        
              @*@Ajax.ActionLink("Assign", "Assign", new { groupid = item.GroupId }, new AjaxOptions { HttpMethod = "POST" })*@
            <input type="submit" name="Assign" />
        </td>

    </tr>
}


</table>
 }

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")


when i click a button it goes to the assign action in users controller, and am getting the values in formcollection object. The issue is when i click a button the group id values are becomes comma deletemeted strings, instead i just want to retreive only one row of where the button was actually clicked.

Hope you can understand and expecting the replies
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900