一個匿名對象如何通過數據我有我的ASP.NET MVC視圖jQuery的數據表。列是這樣的:像jQuery的數據表在asp.net mvc的
"columns": [
{ "data": "Vote", "autoWidth": true },
{ "data": "Answer1", "autoWidth": true },
{ "data": "View", "autoWidth": true },
{
"data": "Title", "autoWidth": true,
'render': function (Title)
{
//return '<a href=' + Title + '>' + Title + '</a>';
return '<a href=/Questions/GoForAnswer/?idForAnswer='+ 2+'&title=dfg&question=dfg&view=59&date=08%2F10%2F2016%2023%3A39%3A17&answerNumber=13&vote=113>' + Title + '</a>';
}
}
]
在這裏,在標題欄,我已經硬編碼返回一串objects.But的這些對象是動態的URL。我想將這些發送到查詢字符串中。就像我以前一樣發送它們:
@Html.ActionLink(item.Title, "GoForAnswer", new { idForAnswer = item.ID, title = item.Title, question = item.Question, view = item.View, date = item.Date, answerNumber = item.Answer1, vote = item.Vote })
如何從我的Jquery函數發送對象。
但是,我不知道確切的名字,例如你的解決方案。我不能像這樣硬編碼。我需要傳遞一個匿名對象,因爲我們通過html.actionlink() new {name where title = title,age where title = title} 我可以這樣做嗎? –