Recently, the company has to complete the function of popping up messages in real time. Find a third-party control popupwin on the Internet. The pop-up window of this control is the same as the pop-up window of MSN friends, and the effect is quite good. You can use the timer control to obtain data in real time. A small window is displayed.
Popupwin + Ajax asynchronous refresh
Register the control on the page first
<% @ Register Assembly = "eeeksoft. Web. popupwin" namespace = "eeeksoft. Web" tagprefix = "PC3" %>
Add two updatapanel and one scriptmanager to the page.
<Asp: scriptmanager id = "scriptmanager1" runat = "server"/>
<Asp: updatepanel id = "updatepanel1" runat = "server" updatemode = "Conditional">
<Contenttemplate>
<Font
Color = "red"> current Message count: </font> <asp: Label id = "lbshow"
Runat = "server" forecolor = "red"> </ASP: Label>
<PC3: popupwin id = "PW" runat = "server" colorstyle = "red" Title = "welcome to the Management page" dragdrop = "false"
Height = "pixel PX" width = "158px" autoshow = "true" actiontype = "raiseevents" visible = "false"
Dockmode = "bottomright"> </PC3: popupwin>
</Contenttemplate>
</ASP: updatepanel>
<Asp: updatepanel id = "updatepanel2" runat = "server" updatemode = "Conditional">
<Contenttemplate>
<Asp: timer id = "timer1" runat = "server"
Ontick = "timereffectick" interval = "30000" enabled = "true">
</ASP: timer>
</Contenttemplate>
</ASP: updatepanel>
Next we need to use C # To control popupwin.
Try
{
T1.enabled = false;
Popupw. Visible = true;
Popupw. hideafter =-1;
Popupw. autoshow = true;
String MSG = "";
MSG + = "<
Href = \ "inspector_monitor \ reportdetail. aspx? Id = 1 "\"
Target = \ "mainframe \"> "</a> <br/> ";
Popupw. Message = MSG;
Popupw. Title = "New Message available ";
Popupw. colorstyle = eeeksoft. Web. popupcolorstyle. Red;
Popupw. dockmode = eeeksoft. Web. popupdocking. bottomright;
PW. Visible = true;
Popupw. windowscroll = true;
Popupw. Visible = true;
Session ["curtime"] = datetime. Now. tostring ();
}
Finally
{
T1.enabled = true;
}
Recently, the company has to complete the function of popping up messages in real time. Find a third-party control popupwin on the Internet. The pop-up window of this control is the same as the pop-up window of MSN friends, and the effect is quite good. You can use the timer control to obtain data in real time. A small window is displayed.
Popupwin + Ajax asynchronous refresh
Register the control on the page first
<% @ Register Assembly = "eeeksoft. Web. popupwin" namespace = "eeeksoft. Web" tagprefix = "PC3" %>
Add two updatapanel and one scriptmanager to the page.
<Asp: scriptmanager id = "scriptmanager1" runat = "server"/>
<Asp: updatepanel id = "updatepanel1" runat = "server" updatemode = "Conditional">
<Contenttemplate>
<Font
Color = "red"> current Message count: </font> <asp: Label id = "lbshow"
Runat = "server" forecolor = "red"> </ASP: Label>
<PC3: popupwin id = "PW" runat = "server" colorstyle = "red" Title = "welcome to the Management page" dragdrop = "false"
Height = "pixel PX" width = "158px" autoshow = "true" actiontype = "raiseevents" visible = "false"
Dockmode = "bottomright"> </PC3: popupwin>
</Contenttemplate>
</ASP: updatepanel>
<Asp: updatepanel id = "updatepanel2" runat = "server" updatemode = "Conditional">
<Contenttemplate>
<Asp: timer id = "timer1" runat = "server"
Ontick = "timereffectick" interval = "30000" enabled = "true">
</ASP: timer>
</Contenttemplate>
</ASP: updatepanel>
Next we need to use C # To control popupwin.
Try
{
T1.enabled = false;
Popupw. Visible = true;
Popupw. hideafter =-1;
Popupw. autoshow = true;
String MSG = "";
MSG + = "<
Href = \ "inspector_monitor \ reportdetail. aspx? Id = 1 "\"
Target = \ "mainframe \"> "</a> <br/> ";
Popupw. Message = MSG;
Popupw. Title = "New Message available ";
Popupw. colorstyle = eeeksoft. Web. popupcolorstyle. Red;
Popupw. dockmode = eeeksoft. Web. popupdocking. bottomright;
PW. Visible = true;
Popupw. windowscroll = true;
Popupw. Visible = true;
Session ["curtime"] = datetime. Now. tostring ();
}
Finally
{
T1.enabled = true;
}