且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

asp.net MVC 3剃须刀。浏览查看表TR点击

更新时间:2023-02-14 19:57:58

如果不使用jQuery,假设你在foreach循环中像下面的东西是,只是​​改变了 TR 定义是这样的:

Without using jQuery, assuming you're in a foreach loop like something below, just change the tr definition to be something like:

@foreach (var user in Model.Users)
{
    <tr onclick="location.href = '@(Url.Action("ShowProfile", "Users", new { userId = user.UserId }))'">
    //rest of your markup for that table row
    </tr>
}