Home Use Html.ActionLink on entire table row
Reply: 0

Use Html.ActionLink on entire table row

user1362
1#
user1362 Published in August 15, 2018, 11:16 am

I have an @Html.ActionLink within my <td> element on my table which works fine

When I move the link to the <tr>, it does not work

Is this approach permitted against the entire row? I am trying to make the entire row clickable to run the action rather than the column

My code is

@foreach (var member in @Model.Memberships)
{
    <tr>
       ---> TRYING TO RUN THIS HERE -- @Html.ActionLink("Switch", "SwitchMembership", "HomePageSurface", new { membershipNumber = member.MembershipNumber, schemeType = member.SchemeType, memberStatusType = member.MemberStatusType, scheme = member.Scheme, returnUrl = Request.Url.AbsolutePath })
        @if (member.Selected)
        {
            <td class="visible-xs"><span class="user-management-current"><i class="fa fa-check"></i></span></td>
        }
        else
        {
            <td class="visible-xs">@Html.ActionLink("Switch", "SwitchMembership", "HomePageSurface", new { membershipNumber = member.MembershipNumber, schemeType = member.SchemeType, memberStatusType = member.MemberStatusType, scheme = member.Scheme, returnUrl = Request.Url.AbsolutePath }, new { @class = "icon-arrow-right" })</td>
        }
        ...
    </tr>
}
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.314394 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO