Javascript alert not working from code behind

后端 未结 3 1770
闹比i
闹比i 2021-01-28 11:29

I am generating a javascript alert box from codebehind in asp.net(vb).

The code:

            Catch ex As Exception
                MesgBox(\"Error in up         


        
3条回答
  •  忘了有多久
    2021-01-28 11:50

    JavaScript does not allow string constants to span line breaks.

    In your server-side code, you're going to have to replace the newlines in the error message with "\n".

提交回复
热议问题