try with 2 escapes: likepopup('test\\n1123');when c# find only one scape char, the compiler think that you whant torenderize with the new line. but if you scape the '\n' with other '\' ,it will work.try yhe same with the \r