How can we split the Popup feature from the Forum code of Baoyu?

Source: Internet
Author: User
How can we split the Popup feature from the Forum code of Baoyu?
Prepared by: Zheng Yu
Time: 20050128
We need to send a request to the IE front-end in the background and let the browser pop up a Popup to prompt the user, instead of making a timer to constantly retrieve data from the background to prompt the forum for new posts.
In this way, the following file is extracted from the source code CnForums1 [1]. 2:
L PopupManager. cs (removes the reference code for ASPnetForum );
L SkinnedForumWebControl. cs (removes the reference code for ASPnetForum );
L PopupManager. js;
L PopupManager. ascx under the Skins directory;
L popupmanager.css under the CSS directory;
L all images under the images directory;
Add these files to your project.

Add the following to your default. aspx page:
<Link rel = 'stylesheet 'type = 'text/css 'href = 'css/popupManager.css'>
<Script src = "Scripts/PopupManager. js" type = "text/javascript"> </script>


And
<Exp: PopupManager runat = "server" ID = "Popupmanager1" Visible = "False" EnableViewState = "False"/>



Then, add the following code to default. aspx. cs:
Protected Linktone. ToneReports. Components. PopupManager Popupmanager1;

/// <Summary>
/// Use this function to set attributes of the Popup window beyond the IE window
/// </Summary>
/// <Param name = "sender">
/// Sender
/// </Param>
/// <Param name = "sTitle"> complete information about Popup </param>
/// <Param name = "sInfo"> brief message about Popup </param>
///
Private void Popup (
String sTitle,
String sInfo)
{
Popupmanager1.Visible = true;
// Edit the script language to be executed
String javaScript = @ "<script language = javascript> try {var popupManager = new PopupManager ();" +
"Var p = popupManager. AddPopup ('popupwin', '" + sTitle +
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.