我在后台aspx.cs代码中写了下面的一个方法: /// <summary>
/// 返回一级分类的个数
/// </summary>
/// <returns></returns>
public string getChar()
{
string sql = "select count(I_id) term from mm_goodstype where s_parentid=0";
string term;
try
{
term =Convert.ToString(SqlHelper.ExecuteScalar(DataBase.StrConn, CommandType.Text, sql));
return term;
}
catch (Exception e)
{
string errMes = e.Message.ToString();
return null;
}
}
然后我想在.aspx页,也就是在html页获得上面这个方法的返回值,
var rn=<%# getChar()%>
可是没有获得到,请问应该怎么写,在线等,谢谢。急!!!!
/// 返回一级分类的个数
/// </summary>
/// <returns></returns>
public string getChar()
{
string sql = "select count(I_id) term from mm_goodstype where s_parentid=0";
string term;
try
{
term =Convert.ToString(SqlHelper.ExecuteScalar(DataBase.StrConn, CommandType.Text, sql));
return term;
}
catch (Exception e)
{
string errMes = e.Message.ToString();
return null;
}
}
然后我想在.aspx页,也就是在html页获得上面这个方法的返回值,
var rn=<%# getChar()%>
可是没有获得到,请问应该怎么写,在线等,谢谢。急!!!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货