MsnMessage
仿MSN的消息提示,挺好用的一个控件,下载地址http://www.codeproject.com/aspnet/asppopup.asp
这里我实现的功能是根据查出来的新闻条数,显示相应数目的提示窗口
也可点击此下载:popupdll
代码
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{ //这一段是自己的查询函数根据自己的项目
Com.Greating.ShipAgent.Components.CommonCode.SplacardManager SM = new
Com.Greating.ShipAgent.Components.CommonCode.SplacardManager();
repSplacard.DataSource = SM.Query();
repSplacard.DataBind();
Com.Greating.ShipAgent.Model.dsSPlacard ds = SM.Query();
int x = 0;
int y = 0;
for (int i = 0; i < ds.Splacard.Rows.Count; i++)
{
Com.Greating.ShipAgent.Model.dsSPlacard.SplacardRow row = ds.Splacard.Rows[i]
as Com.Greating.ShipAgent.Model.dsSPlacard.SplacardRow;
//前面的可以不用看,后面才是控件的使用。。。
EeekSoft.Web.PopupWin popupWin = new EeekSoft.Web.PopupWin();
placeHolder.Controls.Add(popupWin);
popupWin.ActionType = EeekSoft.Web.PopupAction.MessageWindow;
popupWin.Title = "公告栏提醒";
popupWin.Message = "<a href='SystemManage/CPlacardDetail.aspx?SPLAID=
" + row.SPLA_Id + "'>" +row.SPLA_Summary+"</br>" + row.SPLA_Content+ "</a>";
popupWin.Text = "Text to show in new window..";
popupWin.HideAfter = 50000;
popupWin.Width = 300;
popupWin.Height = 200;
popupWin.WindowScroll = true;
popupWin.DragDrop = true;
// Show popup
popupWin.Visible = true;
popupWin.AutoShow = true;
//每增加一个popup就提示窗口就向左和向上各移动20个单位,这样不至于提示窗口重叠
x += 20;
y += 20;
popupWin.OffsetX += x;
popupWin.OffsetY += y;
}
}
}
</script>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{ //这一段是自己的查询函数根据自己的项目
Com.Greating.ShipAgent.Components.CommonCode.SplacardManager SM = new
Com.Greating.ShipAgent.Components.CommonCode.SplacardManager();
repSplacard.DataSource = SM.Query();
repSplacard.DataBind();
Com.Greating.ShipAgent.Model.dsSPlacard ds = SM.Query();
int x = 0;
int y = 0;
for (int i = 0; i < ds.Splacard.Rows.Count; i++)
{
Com.Greating.ShipAgent.Model.dsSPlacard.SplacardRow row = ds.Splacard.Rows[i]
as Com.Greating.ShipAgent.Model.dsSPlacard.SplacardRow;
//前面的可以不用看,后面才是控件的使用。。。
EeekSoft.Web.PopupWin popupWin = new EeekSoft.Web.PopupWin();
placeHolder.Controls.Add(popupWin);
popupWin.ActionType = EeekSoft.Web.PopupAction.MessageWindow;
popupWin.Title = "公告栏提醒";
popupWin.Message = "<a href='SystemManage/CPlacardDetail.aspx?SPLAID=
" + row.SPLA_Id + "'>" +row.SPLA_Summary+"</br>" + row.SPLA_Content+ "</a>";
popupWin.Text = "Text to show in new window..";
popupWin.HideAfter = 50000;
popupWin.Width = 300;
popupWin.Height = 200;
popupWin.WindowScroll = true;
popupWin.DragDrop = true;
// Show popup
popupWin.Visible = true;
popupWin.AutoShow = true;
//每增加一个popup就提示窗口就向左和向上各移动20个单位,这样不至于提示窗口重叠
x += 20;
y += 20;
popupWin.OffsetX += x;
popupWin.OffsetY += y;
}
}
}
</script>
效果如下:
明天再写,代码编辑器里实在不好修改