功能很简单,单击按钮插入一数据到数据库。vs2003+sql2000,C#,web应用程序。 我的后台方法测试成功,是没有问题的;Ajax的引用也是成功的;就是调用不成功不知为何,脚本老是提示:对象不支持此属性和方法。源码不多,请看:
-- 前台文件的:
--
<input type="button" value="Button" />
-- 后台文件:
--
private void Page_Load(object sender, System.EventArgs e)
{
Ajax.Utility.RegisterTypeForAjax(typeof(smx.xsb.mmlist), this.Page);
}
[Ajax.AjaxMethod]
private void insert_d()
{
ttc.bbc.RunSQL run = new ttc.bbc.RunSQL();
run.ExecSQL("insertdata " + Session["userid"].ToString() + "," + Session["username"].ToString() + "");
}