中的RegisterStartupScript警报错误我的RegisterStartupScript在代码隐藏类提醒错误信息 - 它工作得很好,除了当错误已经换行或回车(我认为)。下面是摘录:当回车是字符串
注释代码工作正常!
catch (Exception ex)
{
//Page.ClientScript.ScriptManager.RegisterStartupScript(Page, Page.GetType(), "Failure", "alert('ERROR: '), true);
Page.ClientScript.RegisterStartupScript(this.GetType(), "System Error", "alert('" + ex.Message.Replace("'", "\\'") + "');", true);
}
所以,我不知道我明白这个问题。你是说你的错误出错了吗? – paqogomez
警报消息从不出现。 – user1967701
请阅读[“SQL注入”](http://en.wikipedia.org/wiki/SQL_injection) - 它适用于许多语言/条件(包括你的) - 由用户提供的串/外部实体不能被放置转换为没有适当编码的脚本,或者更好的语言特定机制来传递文本值。 –