The code needs two things to escape.
string text = "test \\n testing";
ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('Ouve algum problema nos itens " + text + "');", true);
using:
string text = "test \\n testing";
Instead:
string text = "test \n testing";
source
share