下面的调用有点问题,该如何修改,当然CS方法是没问题的,
怎么做才能实现点击按钮时,正确调用CS的更新价格的方法aa.aspx.cs
page_load(object sender, ee e)
{
ajaxpro.xxx.xxx(typeof(aa));
}
[ajaxpro.ajaxmethod]
public void updateprice(int uin)
{
string id=resquest.querystring("id");
string constr="连接字符串";
sqlconnection con=new sqlconnection(constr);
con.open();
sqlcommmand = new sqlcommand("存储过程名", con);
try
{
cmd.ExcuteNoquery();
}
catch(Exception ex)
{
response.write(ex.message);
}
finally
{
con.close();
}
}aa.aspx
<script>
function updatepricebyuin()
{
var uin = 20025;
aa.updateprice(uin);
}
</script>
<input type="button" name="updateprice" id="updateprice" value="更新价格" onclick="updatepricebyuin();">
怎么做才能实现点击按钮时,正确调用CS的更新价格的方法aa.aspx.cs
page_load(object sender, ee e)
{
ajaxpro.xxx.xxx(typeof(aa));
}
[ajaxpro.ajaxmethod]
public void updateprice(int uin)
{
string id=resquest.querystring("id");
string constr="连接字符串";
sqlconnection con=new sqlconnection(constr);
con.open();
sqlcommmand = new sqlcommand("存储过程名", con);
try
{
cmd.ExcuteNoquery();
}
catch(Exception ex)
{
response.write(ex.message);
}
finally
{
con.close();
}
}aa.aspx
<script>
function updatepricebyuin()
{
var uin = 20025;
aa.updateprice(uin);
}
</script>
<input type="button" name="updateprice" id="updateprice" value="更新价格" onclick="updatepricebyuin();">
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货