[ASP.NET] A practical pop-up window function

xiaoxiao2021-03-06  100

Public static void OpenPopup (System.Web.ui.WebControls.WebControl Opener, String PagePath, String Windowname, Int Top, Int Left, Int Width, Int Height)

{

String clientscript;

String windowattribs;

WindowAttribs = "left =" Left.toString () "PX,"

"TOP =" Top.Tostring () "PX,"

"width =" width.toString () "px,"

"height =" height.toString () "px,"

"Left = ' (Screen.Width -" Width.toString () ") / 2) ',"

Clientscript = "WINDOW.OPEN ('" PagePath "', '"

Windowname "','" windowattribs "; return false;";

Opener.attributes.add ("

Onclick ", Clientscript);

}

Private Void Page_Load (Object Sender, System.EventArgs E) {// Place the user code here to initialize the page if (! ispostback) {OpenPopup (Button1, "http:////www.google.com";); OpenPopup Button2, "http://www.google.com"; "", "", 0, 0, 300, 300);}}

转载请注明原文地址:https://www.9cbs.com/read-96111.html

New Post(0)