First view results
Front-endCode
<% @ Page Language = " C # " Autoeventwireup = " True " Codefile = " Div pop-up center. aspx. CS " Inherits = " Div pop-up center " %>
<! Doctype HTML public " -// W3C // dtd xhtml 1.0 transitional // en " " Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " >
< HTML xmlns = " Http://www.w3.org/1999/xhtml " >
< Head runat = " Server " >
< Title > No title page </ Title >
<Script SRC="Scripts/jquery-1.3.2.min.js"Type="Text/JavaScript"> </Script>
< Script Language = " Javascript " Type = " Text/JavaScript " >
Function divcenter (I)
{
VaR divid = Document. getelementbyid ( ' Div1sss ' );
Document. getelementbyid ( ' Div1sss ' ). Innerhtml = I;
Document. getelementbyid ( " Div1sss " ). Style. Display = " Block " ;
$ ( " # Div1sss " ). Fadeout ( 13000 , Function (){});
}
Function attachpolicweventhandler ( Event , Func)
{
If (Navigator. appname = ' Netscape ' )
{
Window. addeventlistener ( Event , Func, False );
}
Else
{
Window. attachevent ( ' Onload ' , Func );
}
}
</ Script >
< Style Type = " Text/CSS " >
# Div1sss
{
Position: absolute;
Top: 50 % ;
Left: 50 % ;
Margin - Top: - 25px;
Margin - Left: - 150px;
Color: blue;
Width: 300px;
Height: 50px;
Font - Weight: bold;
Border: solid 1px gray;
Line - Height: 50px;
Font - Size: 20px;
Text - Align: center; </ Style >
</ Head >
< Body >
< Form ID = " Form1 " Runat = " Server " >
< Table width = " 100% " >
< Tr >
< TD >
< ASP: button ID = " Button1 " Runat = " Server " Text = " Button " Onclick = " Button#click " />
< SPAN onclick = " Divcenter () " > Test </ Span >
</ TD >
</ Tr >
</ Table >
< Div ID = " Div1sss " Style = " Display: none; position: absolute; Background-color: yellow; " >
</ Div >
</ Form >
</ Body >
</ Html >
Background code
Protected void button#click (Object sender, eventargs E)
{
Utility. MessageBox. alertscript ("attachpolicweventhandler ('', function () {divcenter ('success ');})");
}