我有这样的代码:
ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('Ouve algum problema nos itens " + text + "');", true); 其中,\n是一个字符串,因为我试图在文本消息中插入文本,但没有显示任何文本。
发布于 2010-12-17 02:37:12
您的代码文本需要两个转义元素。
string text = "test \\n testing";
ScriptManager.RegisterStartupScript(this, GetType(), "alert", "alert('Ouve algum problema nos itens " + text + "');", true); 使用:
string text = "test \\n testing";而不是:
string text = "test \n testing";发布于 2010-12-17 02:28:57
", True"将添加脚本标记。
你想要GetType(Page)
https://stackoverflow.com/questions/4464075
复制相似问题