response.Replace(Environment.NewLine,"\n");On the browser end:
var result: string = alertMessage.replace('\r\n', '\n');I tried on the server side, but the result is not what I'd like (the new lines are not properly displayed). I may try now Thierry's idea.