Use the PopupWin control to implement the message push function.

Source: Internet
Author: User

Use the PopupWin control to implement the message push function.

Recently, the project needs to urgently implement the message push function, and many methods have been tried in succession. For example, JavaScript is used for implementation, and the results are not very good. Finally, I found the PopupWin, I started to use it because the results were good.

1. Preparations: Download "EeekSoft. Web. PopupWin. dll" online first ". Put it under the root directory of your project and add references.

2. Add

<%@ Register TagPrefix="cc1" Namespace="EeekSoft.Web" Assembly="EeekSoft.Web.PopupWin" %>
3. Add controls

      <cc1:PopupWin ID="popupWin" Style="z-index: 105; left: 296px; position: absolute;            top: 528px" runat="server" Width="230px" Height="100px" WindowSize="300, 200"            WindowScroll="False" ColorStyle="Blue" GradientDark="210, 200, 220" TextColor="0, 0, 3"            Shadow="125, 90, 160" LightShadow="185, 170, 200" DarkShadow="128, 0, 102" Visible="False"            ShowLink="True" OffsetX="150" ActionType="OpenLink" LinkTarget="_blank" >        </cc1:PopupWin>

<Span style = "white-space: pre"> </span> <asp: button ID = "btn_Popup" runat = "server" Text = "pop-up window" OnClick = "btn_Popup_Click"> </asp: Button>
4. Background code

Protected void btn_Popup_Click (object sender, EventArgs e) {// set the automatic hide time // popupWin. HideAfter = (sender = null )? -1: 5000; // popupWin. visible = true; popupWin. title = "aaaaaaaa"; popupWin. message = "bbbbbbb"; popupWin. text = "cccccc"; popupWin. dragDrop = true; // you can specify the position to be displayed. dockMode = PopupDocking. bottomRight; // you can specify the popupWin color in the pop-up window. colorStyle = EeekSoft. web. popupColorStyle. green; popupWin. hideafter= 50000; popupWin. showafter= 500; popupWin. visible = true ;}
In this way, a simple pop-up window can be implemented.

Then let's take a look at the attributes of the haopupwin control so that we can better use it.

    1. ActionType: Action type (after clicking the link), return the PopupAction enumeration. (Note: If you want to use related click events, such as OnLinkClicked and OnPopupClosed, it must be set to RaiseEvents) and OnLinkClicked is an event triggered when you click a link in a small window, onPopupClosed triggers an event when you click to close a small window.
    2. Text: set or get the Text to be displayed in the new window
    3. Link: sets or obtains the address or js script opened when a connection is clicked.
    4. LinkTarget: set or obtain the connection opening target method.
    5. ColorStyle: sets or obtains the color style, and returns the PopupColorStyle enumeration.
    6. Message: set or obtain the information displayed in the pop-up window.
    7. Title: set or obtain the Title of the pop-up window and the new window
    8. GradientLight: set or obtain the brightness color.
    9. GradientDark: set or obtain the dark color (in Mozilla, the background color)
    10. TextColor: set or obtain the text color.
    11. LightShadow: set or obtain the brightness shadow color.
    12. DarkShadow: set or obtain the color of the dark shadow.
    13. Shadow: set or obtain the Shadow color.
    14. DockMode: set or obtain the shrinking status of the pop-up window, and return the PopupDocking enumeration.
    15. OffsetX: set or obtain the offset coordinates of the X axis (from left or right)
    16. OffsetY: set or obtain the offset coordinates of the Y axis (from the bottom)
    17. HideAfter: sets or obtains the time displayed in the window. The default value is 500 milliseconds (-1 indicates unlimited time)
    18. PopupSpeed: set or obtain the pop-up speed. The default value is 20.
    19. ShowAfter: sets or obtains the delay time before the displayed window. The default value is 1000 milliseconds.
    20. AutoShow: the pop-up window is automatically displayed when the page is loaded (after the ShowAfter attribute is set)
    21. DragDrop: set or obtain whether to allow dragging in the pop-up window
    22. WindowSize: set or obtain the window size
    23. WindowScroll: sets or obtains whether the scroll bar is allowed in the new window.
    24. ShowLink: whether to display the connection and enable actions in the pop-up window
If you want to set the ActionType in the background, the code is EeekSoft. Web. PopupAction. OpenLink; that's all. If there are any omissions, add them later.

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.