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 comment wattribs;
Required wattribs = "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 hereCodeTo initialize the page
If (! Ispostback)
{
Openpopup (button1, "http://www.google.com ";);
Openpopup (button2, "http://www.google.com";, "", 300,300 );
}
}