ScriptManager.RegisterStartupScript(Page, Type, string,string,bool)无法换行
ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Alert","alert(\"第一行\r\n第二行\")",true);会报脚本错误
ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Alert","alert(\"第一行第二行\")",true);这样就正常.
解决方案:
ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "Alert","alert('\\n第一行\\n第二行')",true);