我这段代码进行给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>
大哥门救命啊
代码如下:
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>
解决方案 »
- js 中如何调用asp.net后台中的Session变量
- asp.net 如何操作摄像头,类似于csdn头像操作
- asp.net 2.0网站 本地iis浏览没问题,发布到万网支持2.0的空间后,只要访问.aspx页面,就报错
- “asp:ListItem”的“Text”属性不允许子对象
- 更改IP IIS不可用
- 大型网站,怎么存储用户信息
- C#获取登陆时间,并无刷新即时显示,要包括秒的跳动!
- 十万火急 vs.net 运行时 数据集不见了 解决者另开帖再加100分
- 求日期的转换怎么样把2003-1-2转换为2003年1月2日
- ASP.NET调试的难题(非一般的难)
- 如何用 xmlhttp 传递 xml 并在服务器端接收
- ASP.NET中 如何在web窗体关闭后执行后台函数
Timer确实是自己定义的.因为我没有在前台声明这个控件.只是在CS里写的.
有什么办法执行我的方法吗?
System.Threading和System.Timers命名空间下的Timer貌似没有Tick哦而winform下的Timer有这个Tick可是您这个不是Aspx么?
您打算在Asp.net下使用窗体控件?
但是我只要把这个框加到Timer_Tick里边就不好使.但是放在Page_Load里就好用.
public partial class shengyin : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
pw.Visible = false;
}
pw.Text = "现在已经有新的单子";
pw.DockMode = EeekSoft.Web.PopupDocking.BottomLeft;
pw.Message = "您有新短消息,请注意查收";
}
protected void Timer1_Tick(object sender, EventArgs e)
{
pw.Visible = true; //PW是消息提醒框的控件(PopupWin)
Label1.Visible = false;
}
}
我如何才可达到.每几秒种.查询一次数据库.如果有数据的话.这个消息提示框就显示出来.
各位大哥.帮帮忙吧.麻烦给些代码.不要就说几句好吗??..谢谢了~!~@!
改成这样
tm.Tick += new EventHandler<EventArgs>(Timer_Tick); 就可以了