Since this is still happening, and this is a nuisance, I decided that at least I would let others know what I ultimately used as a βhackβ. I don't want to ignore the warning and would rather agree with the hokier syntax (and yes, someone will say that this will kill performance :))
As a workaround, I use the addition of the client side at the end. For me, this error occurred while defining the constant "integer", therefore
window.foo = @(Model.Something);
gave me a good old semicolon. I just changed this to:
window.foo = @Model.Something + 0;
(In the stated question, you should simply add ``, therefore + ''.
I know that on the client there is another addition, and it is not elegant, but it helps to avoid an error. So use it or not, but I prefer it to see a warning / error.
If anyone knows of a server side syntax workaround for this, I would prefer it on the client side, so please add.
Mirko Apr 01 '13 at 17:56
source share