這裏是我的問題:在Asp.net代碼中使用Javacscript參數包含在javascript函數
<script>
function processRequest(username, sessionToken, connectionId, processType,friendUser) {
var request = { Username: username, Password: null, SessionToken: sessionToken, ConnectionId: connectionId, ProcessType: processType };
$.ajax({
type: "POST",
url: '@ConfigurationSettings.AppSettings["APIURL"]/people/ProcessConnectRequest',
data: request,
datatype: "jsonp",
success: function(result) {
if (result === "PROCESSED") {
$('#item_' + connectionId).remove();
var htmlContent ='<div class="col-lg-4 gray-box">'
+'<div class="general-item-list" id="requestList">'
+ '<div class="item">'
+ '<div class="item-head">'
+ '<div class="item-details">'
+ '@Html.Action("LoadPeopleStatus", "People", new { id ="abc"})'
+ '</div>'
+ '</div>'
+ '</div>'
+ '</div>'
+ '</div>';
$('#containerBox').append(htmlContent);
}
}
});
}
我想friendUser
參數來代替id ="abc"
,但沒有成功。任何想法?
您正在將客戶端邏輯與服務器端模板混合使用。這不是工作,永遠。 –
謝謝,我會更改我的代碼 – HideTran
試試這個'id = friendUser' –