打开指定大小的模式窗体

public   static   void  ShowModalDialogWindow( string  webFormUrl,  int  width,  int  height,  int  top,  int  left)
        
{
            
#region
            
string features = "dialogWidth:" + width.ToString() + "px"
                
+ ";dialogHeight:" + height.ToString() + "px"
                
+ ";dialogLeft:" + left.ToString() + "px"
                
+ ";dialogTop:" + top.ToString() + "px"
                
+ ";center:yes;help=no;resizable:no;status:no;scroll=yes";
            ShowModalDialogWindow(webFormUrl, features);
            
#endregion

        }

public static void ShowModalDialogWindow(string webFormUrl, string features)
        
{
            
string js = ShowModalDialogJavascript(webFormUrl, features);
            HttpContext.Current.Response.Write(js);
        }


        
public static string ShowModalDialogJavascript(string webFormUrl, string features)
        
{
            
#region
            
string js = @"<script language=javascript>                            
                            showModalDialog('
" + webFormUrl + "','','" + features + "');</script>";
            
return js;
            
#endregion

        }
 

你可能感兴趣的:(模式)