后台代码:
public UserWEB ToCall(string name)
{
string sql = "select * from UserWEB where name=@name";
UserWEB userweb = new UserWEB();
SqlParameter[] param = new SqlParameter[]
{
new SqlParameter("@name",name)
};
using (DataSet ds=DBHelper.Fill(CommandType.Text,sql,param))
{
if (ds.Tables[0].Rows.Count>0)
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
userweb.Name = ds.Tables[0].Rows[i]["name"].ToString();
userweb.Type = ds.Tables[0].Rows[i]["type"].ToString();
}
}
}
return userweb;
}
public void QueryAndBind(string name)
{
UserWEB userweb = new UserWEB();
userweb = this.ToCall(name);
this.LblFile.Text = userweb.Type;
}
前台JS:
<script type="text/javascript" language="javascript">
function bind()
{
var QBind="<%=QueryAndBind()%>";
alert(QBind);
}
</script>
调用:
<li class="top"><a href="#nogo2" id="products" class="top_link"><span class="down" onclick="toggle('div1','silver' ),sAlert('div1','#0000FF'),bind();"><font color="Lime">来电弹屏</font></span></a>
前台
<div id="div1" align="center" runat="server" >内容
<asp:Label ID="LblFile" runat="server" Text="Label"></asp:Label>
</div>
能正常运行起来但是却只执行前2个JS的 后面那个JS没有执行 为什么呢