ASP.net页面中控件更新数据库,我打断点为什么不能进入ontick方法呢?
页面:
<body onload="startup()">
<div id="imgArea" onmousemove="mouseMove()" onmouseover="mouseIn()" onmouseout="mouseOut()">
<form id="form1" runat="server">
<div id="two">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick2">
</asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</div>
</body>
后台方法:
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using tazf.BusinessLogicLayer;
using tazf.Entity;
public partial class _Default : System.Web.UI.Page
{
private System.Timers.Timer timer1;
protected void Timer1_Tick2(object sender, EventArgs e)
{
int result = 0;
string jis = "select jishi from kj_xueyuan where id='" + Request["dqid"] + "'";
DataTable dt = code.GetTable(jis);
string hh = Request["dqid"];
string jj = "";
for (int i = 0; i < dt.Rows.Count; i++)
{
if (dt.Rows[i]["jishi"].ToString() != null)
{
jj = dt.Rows[i]["jishi"].ToString();
result = int.Parse(jj);
}
}
int gengxin = 0;
gengxin += 1;
string Sql;
Sql = "Update kj_xueyuan set jishi=" + (result + 1) + " where ID=" + hh;
code.UpDate(Sql);
}
}
配置文件在下面评论里
请各位大神帮忙