嗨,我想请问下,我想通过后台代码调用前台Js方法来给表格赋值。但是会报:Microsoft JScript 运行时错误: 对象不支持此属性或方法。
后台方法:
protected void Button6_Click(object sender, EventArgs e)
{
System.Web.UI.ScriptManager.RegisterStartupScript(this.Button6, Button6.GetType(), "", "JsSetGridValue('" + "FpSpread1" + "','" + 0 + "','" + 3 + "','" + "CJB" + "')", true);
//ClientScript.RegisterStartupScript(typeof(Button), "CJB", "<script type ='text/javascript'> JsSetGridValue('" + "FpSpread1" + "','" + 0 + "','" + 3 + "','" + "CJB" + "');</script>");
}
前台Js:
function JsSetGridValue(valGridname, valRow, valCol, valValue) {
var spreadname = valGridname;
var spread = document.all(spreadname);
if (spread != null) {
spread.SetValue(valRow, valCol, valValue, true);
}
}
以上如何解决?谢谢! |