为什么AjaxPro操作数据库时返回null
----.cs------
[AjaxPro.AjaxMethod]
public bool PublishTopic()
{
return CommonSql.ExecuteNonQuery( "P_System_Config_UpdateVisitor ");
}
----.js------
function LeaveWord_CallBack(ref) {
alert(ref.value);
//ifrLeaveWord.window.location.reload();
//$( "Form1 ").reset();
}
----ExecuteNonQuery----
/// <summary>
/// 执行不返回结果的 SQL 存储过程
/// </summary>
/// <param name= "sql "> SQL 存储过程 </param>
public bool ExecuteNonQuery(string sql)
{
try
{
SqlCommand command = Conn.CreateCommand();
command.CommandType = CommandType.StoredProcedure;
command.CommandText = sql;
Conn.Open();
command.ExecuteNonQuery();
return true;
}
catch (Exception ex)
{
string message = ex.Message;
return false;
}
finally
{
Conn.Close();
}
}
设置了断点做调试,发现根本就没有执行ExecuteNonQuery方法,直接返回了null,如果改成
public bool &nbs