Please Tell Me How to Pass Dynamic ID in Jquery Using Action Link

Please Tell Me How to Pass Dynamic ID in Jquery Using Action Link

LakhbirChandelLakhbirChandel Posts: 10Questions: 0Answers: 0
edited February 2012 in General
Hello Sir, This Is my Code



$.ajax({
type: 'GET',
url: '@Url.Action("GetDetails")',
dataType: 'json',
contentType: 'application/json; charset=utf-8',
processData: true,
success: function (data) {
//alert(data);
oTable.fnClearTable();
var s = i;
for (var i = 0; i <= data.length; i++) {
var s = i;
//alert(s);
var EditFinal = '@Html.ActionLink("Edit", "Edit", new { id = 1})';
var DeleteResult = '@Html.ActionLink("Delete", "Delete", new { id = 1 })';
//alert(data[i].fnExclusiveRate);
$('#Detail').dataTable().fnAddData([
data[i].fiCityId,
data[i].fvDistrictName,
data[i].fvCityName,
EditFinal.toString(),
DeleteResult.toString()
]);
}
},
error: function (data) {
alert("no");
alert(data);
}
});



Here i Pass I Static ID as new { id = 1 } but i Want to Pass Dynamic Id which is in Variable s . so tell me How I Pass here Dynamically..
Thanks..

Replies

  • m4l33nm4l33n Posts: 0Questions: 0Answers: 0
    i think this is what you looking for:

    http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/199579
This discussion has been closed.