在 asppopup.aspx" target=_blank _fcksavedurl="http://www.codeproject.com/aspnet/asppopup.asp">codeproject 上看到一個很不錯的控件,完全能夠自定義彈出窗口的樣式、內容、鏈接,該控件支持Mozilla, Internet Explorer 和 Opera,我試用了一下,效果非常不錯,推薦大家使用。
#region members
protected AgronetControl.PopupWin pwVegnet;
private string downmoontest="downmoontest";
#endregion
#region Events
private void Page_Load(object sender, System.EventArgs e)
{
pwVegnet.LinkClicked+=new EventHandler(pwVegnet_LinkClicked);
this.pwVegnet.Visible=false;
if(!IsPostBack)
{
bool bl=IsShowMessage();
if(bl)
{
SetMessage();
setCookies(downmoontest,"yes",1);
}
else
{
this.pwVegnet.Visible=false;
}
}
}
/// <summary>
/// 注銷按鈕
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnLogOff_Click(object sender, System.EventArgs e)
{
RemoveAll();
}
private void pwVegnet_LinkClicked(object sender, EventArgs e)
{
//此處可以加上"下次是否顯示之類的腳本"---downmoon
Page.Response.Redirect(@"http://www.vegnet.com.cn/user/");
}
#region Methods
private void SetMessage()
{
pwVegnet.HideAfter = 5000 ;
pwVegnet.Visible = true ;
pwVegnet.Title = textTitle.Text;
pwVegnet.Message = textMsg.Te