我这段代码进行给Tick委托时间.但是就是出错.告诉我无法将类型“System.EventHandler”隐式转换为“System.EventHandler<System.EventArgs>”
大哥门救命啊
代码如下:
using System;
using System.Data;
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 System.Web.Configuration;
using EeekSoft.Web;
public partial class shengyin : System.Web.UI.Page
{
PopupWin pw = new PopupWin();
UpdatePanel up1 = new UpdatePanel();
Timer tm = new Timer();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
pw.Visible = false;
}
pw.ID = "pw";
pw.Text = "现在已经有新的单子";
pw.DockMode = EeekSoft.Web.PopupDocking.BottomLeft;
pw.Message = "您有新短消息,请注意查收";
pw.Visible = false;
tm.ID = "Timer1";
tm.Interval = Convert.ToInt32("3000");
tm.Tick += new EventHandler(Timer_Tick);
this.up1.ContentTemplateContainer.Controls.Add(pw);
this.up1.ContentTemplateContainer.Controls.Add(tm);
}
private void Timer_Tick(object sender, EventArgs e)
{
this.pw.Visible = true;
}
}
前台:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="shengyin.aspx.cs" Inherits="shengyin" %>
<%@ Register Assembly="CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"
Namespace="CrystalDecisions.Web" TagPrefix="CR" %>
<%@ Register Assembly="EeekSoft.Web.PopupWin" Namespace="EeekSoft.Web" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
------解决方案--------------------------------------------------------
你的Timer好象是自定义类
查看下参数类型是不是相符
------解决方案--------------------------------------------------------
控件不是这么加的兄弟
------解决方案--------------------------------------------------------
弱弱的问一下。。你使用的Timer是那个命名空间下的?
System.Threading和System.Timers命名空间下的Timer貌似没有Tick哦
而winform下的Timer有这个Tick。。。可是您这个不是Aspx么?
您打算在Asp.net下使用窗体控件?
------解决方案--------------------------------------------------------
你的控件都没有加入到窗体中。。当然会不对啊。。