Js:
var getDetail = function( id) {
alert(id);
$.ajax({ type: "GET",
url: '<%=Url.Action("GetDiaryDetail","Admin")%>',
data: "id=" + id,
success: function(msg) { alert(msg); }
});
Html:
<a href="#" onclick="getDetail('<%=l.Id %>')">查看</a>
cs:
public string GetDiaryDetail(string pingcoId,string id)
{
//return "GetDiaryDetail";
PingCoChat diaryDetail = _bll.GetDiaryDetail(Convert.ToInt32(id));
return diaryDetail == null ? "没有!" : diaryDetail.Content;
}