If your controller action expects an id query string parameter:
var url = '@Url.Action("Action", "Controller")?id=' + rowid;
or if you want to pass it as part of a route that you can use, replace:
var url = '@Url.Action("Action", "Controller", new { id = "_id_" })'
.replace('_id_', rowid);
Another possibility, if you are going to send an AJAX request, is to pass it as part of the POST body:
$.ajax({
url: '@Url.Action("Action", "Controller")',
type: 'POST',
data: { id: rowid },
success: function(result) {
}
});
or as a query string parameter if you use GET:
$.ajax({
url: '@Url.Action("Action", "Controller")',
type: 'GET',
data: { id: rowid },
success: function(result) {
}
});
All of this assumes that your controller action, of course, accepts an identifier:
public ActionResult Action(string id)
{
...
}
, .