今天在.net中调试了变天的单引号问题:
var strSQL = " exec p_insert ";
var strSQL += " @name= ' " + name + " ' ";
var strSQL = " exec p_insert ";
ScriptManager.RegisterClientScriptBlock(UpdatePanel1, UpdatePanel1.GetType(), "resultScript", String.Format(
@"
$('#result ').html('{0}');
"
, strSQL.Replace(" ' "," ") //之前为 strSQL 一直报错 Uncaught SyntaxError: Unexpected number,修改后替换单引号才正常
), true);
var strSQL = " exec p_insert ";