Uncaught SyntaxError: Invalid or unexpected token

后端 未结 3 440
野趣味
野趣味 2020-12-16 09:14

I have a razor syntax like this:

   foreach(var item in model)
 {
6/16/2016 2:02:29 A         


        
3条回答
  •  温柔的废话
    2020-12-16 10:01

    The accepted answer work when you have a single line string(the email) but if you have a

    multiline string, the error will remain.

    Please look into this matter:

    
    @{
        dynamic item = new System.Dynamic.ExpandoObject();
        item.MultiLineString = @"a multi-line
                                 string";
        item.SingleLineString = "a single-line string";
    }
    
    6/16/2016 2:02:29 AM
    
    

    Change the single-quote(') to backtick(`) in Getinfo as bellow and error will be fixed:

    6/16/2016 2:02:29 AM
    

提交回复
热议问题