The Razor parser is legible, and in some cases it does not parse syntax or color code correctly. Your code will work.
To fix the problem, you can format the code so that the analyzer knows exactly how to understand it. Use parentheses around all links to Razor server codes:
<input type="button" id="btntest" value="Details" onclick="ABC('@(Item.TourApplicationID)', '@(Item.TourID)')" />
Edit: The above may have only worked in VS 2013 with or without an update. (or not at all), I just remember how it worked.
The following is a work taken from MVC3 with an unused string with a syntax error :
<input type="button" id="btntest" value="Details" onclick="@("ABC('" & Item.TourApplicationID & "', '" & Item.TourID & "')")" />
(I think that's right. It's hard to say without color coding.)
I prefer string.format, so onclick will be more like:
onclick="@(String.Format("ABC('{0}', '{1}')", Item.TourApplicationID, Item.TourID) )"
source share