So I'm trying to pass a parameter to a javascript function using the razor '@' notation (in an MVC-4 View) but I'm getting Syntax error: "Unterminated string constant"
Is there another way I should be writing this?
@foreach (var item in Model)
{
...
<input type="button" value="Assign" onclick="AssignButtonClicked('@item.ID')" />
}
I've used the same syntax as this answer https://stackoverflow.com/a/5179316/1662619
Edit:
It's just a syntax error, the functionality still works
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…