var boxIdValue = 233;
var result = title + '<br/>@Html.ActionLink("Detail", "Show", "Boxes", new{boxId=233}, null)';
When I hardcode boxId
then it works. But when I write:
var result = title + '<br/>@Html.ActionLink("Detail", "Show", "Boxes", new{boxId=boxIdValue}, null)';
It doesn't. Is it possible to mix javascript var and razor in this way?
See Question&Answers more detail:os