如何從ActionLink獲取屬性?我有這樣的:如何從actionlink獲取屬性
<table>
@foreach (var item in Model)
{
<tr>
<td>
@Html.ActionLink(item.Name, "Chat", "Home", new { id = item.ID }, new { @class = "Group" })<br />
</td>
</tr>
}
</table>
在重定向頁面,我需要得到item.name
這裏是我的JS:
$('#rooms ul li').not('.nav-header').click(function(e) {
e.preventDefault();
$('#rooms ul li').not('.nav-header').removeClass('active');
$(this).addClass('active');
var roomKey = $(this).data('value');
hub.server.joinGroup(roomKey);
});
是它在檢查元素時在DOM中顯示'href'屬性? –