You are trying to run server-side code alongside client-side code this will not work
function (value) {
var val=value;
@foreach (var item in Model.ToList())
{
if (@item.FKAlbumId == Convert.ToInt32(val.ToString()))
{
return @item.Album.Title;
}
}
}
and give your function a name if you want to call it.
Hope it helps.
And sorry, my english is bad too