C # implement the effect of only one pop-up message after login like msn prompt

Source: Internet
Author: User

InAsppopup. aspx "target = _ blank _ fcksavedurl =" http://www.codeproject.com/aspnet/asppopup.asp ">Codeproject We can see a very good control that can completely customize the style, content, and links of the pop-up window. This control supportsMozilla,Internet ExplorerAndOperaI tried it and it worked very well. We recommend that you use it.

  • Download demo project (C # and VB. NET)-38.1 Kb
  • Download control with source-37.7 Kb
  • Download control documentation-71.1 Kb
  • Open online sample [^].


The following describes how to use this control with cookies to implement the function of reminding users only once after logon!
I. Define variables}

#region members
protected AgronetControl.PopupWin pwVegnet;
private string downmoontest="downmoontest";
#endregion

2. Button events

# RegionEvents
Private VoidPage_Load (ObjectSender, System. EventArgs e)
{
PwVegnet. LinkClicked+ =NewEventHandler (pwVegnet_LinkClicked );
This. PwVegnet. Visible=False;
If(!IsPostBack)
{
BoolBl=IsShowMessage ();
If(Bl)
{
SetMessage ();
SetCookies (downmoontest,"Yes",1);
}
Else
{
This. PwVegnet. Visible=False;
}
}
}
/// <Summary>
///Logout button
/// </Summary>
/// <Param name = "sender"> </param>
/// <Param name = "e"> </param>
Private VoidBtnLogOff_Click (ObjectSender, System. EventArgs e)
{
RemoveAll ();
}
Private VoidPwVegnet_LinkClicked (ObjectSender, EventArgs e)
{
//Here, you can add "whether or not to display a script like" --- downmoon
Page. Response. Redirect (@"Http://www.vegnet.com.cn/user/");
}

Iii. Main Methods:
#region Methods
private void SetMessage()
{
pwVegnet.HideAfter = 5000 ;
pwVegnet.Visible = true ;
pwVegnet.Title = textTitle.Text;
pwVegnet.Message = textMsg.Te

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.