In the displayed window, load the page. Jquery is required. You can drag a window in the pop-up window by adding jquery-UI.
1 VaR _ divmask; 2 VaR _ divbox; 3 4 function showmask () {5 var divmask =6 ('<div> </div>') 6. ATTR ("ID", "divmask") 7. CSS ({8 "position": "absolute", 9 "Left": "0", 10 "TOP": "0", 11 "width": "100% ", 12 "height": "100%", 13 "backgroundcolor": "gray", 14 "opacity": "0.4" 15 }). appendto ("body"); 16 _ divmask = divmask; 17 return divmask; 18} 19 20 function Showbox (title, URL, width, height) {21 showmask (); 22 V Ar divbox =23 ("<div> </div>") 23. ATTR ("ID", "divbox") 24. CSS ({25 "position": "absolute", 26 "TOP": ($ (document ). height ()-height)/2) <0? 0: ($ (document ). height ()-height)/2), 27 "Left": ($ (document ). width ()-width)/2), 28 "width": width, 29 "height": height, 30 "border": "2px solid gray", 31 "backgroundcolor ": "White" 32}) 33. appendto ("body"); 34 var ptitle = $ ("<p> </P>") 35. CSS ({36 "width": (width-20)/2,37 "float": "Left", 38 "padding": "5px", 39 "margin ": "0" 40}) 41. text (title) 42. appendto (divbox); 43 var pclose =$ ("<p> </P> ") 44. CSS ({45 "width": (width-20)/2,46 "float": "Left", 47 "text-align": "right", 48 "padding ": "5px", 49 "margin": "0" 50}) 51. appendto (divbox); 52 var aclose = $ ("<A> </a>") 53. CSS ({54 "color": "black", 55 "text-decoration": "NONE" 56}) 57. ATTR ("href", "javascript: closebox ();") 58. text ("close") 59. appendto (pclose); 60 var hR = $ ("<HR/>") 61. CSS ({62 "margin": "0", 63 "border": "1px solid gray" 64}) 65. Appendto (divbox); 66 var iframecontainer = $ ("<IFRAME> </iframe>") 67. ATTR ("ID", "divcontainer") 68. CSS ({69 "width": width, 70 "height": height-13-ptitle. height (), 71 "float": "Left", 72 "overflow": "Auto", 73 "border": "0" 74}) 75. ATTR ("src", URL) 76. appendto (divbox); 77 _ divbox = divbox; 78 divbox. draggable ({handle: "p"}); 79} 80 81 function closebox (BTN) {82 If (_ divmask = NULL) {83 If (BTN! = NULL & BTN! = '') {84 parent.doc ument. getelementbyid (BTN ). click (); 85} 86 comment (parent.doc ument. getelementbyid ("divmask ")). remove (); 87 objects (parent.doc ument. getelementbyid ("divbox ")). remove (); 88} 89 else {90 _ divmask. remove (); 91 _ divbox. remove (); 92} 93}
1 namespace hylbox 2 { 3 public static class BoxHelper 4 { 5 public static void ShowBox(Page page, string title, string url, int width, int height) 6 { 7 string scriptStr = string.Format("ShowBox(‘{0}‘,‘{1}‘,{2},{3})", title, url, width, height); 8 ScriptManager.RegisterClientScriptBlock(page, page.GetType(), "showBox", scriptStr, true); 9 }10 11 public static void CloseBox(Page page, string btn)12 {13 string scriptStr = string.Format("CloseBox(‘{0}‘)", btn);14 ScriptManager.RegisterClientScriptBlock(page, page.GetType(), "closeBox", scriptStr, true);15 }16 }17 }