我用showmodleDilog()弹出的窗口如何指定它的大小?

解决方案 »

  1.   

    public static void popUpWindow(System.Web.UI.Page mypage,string YesURL,int Width,int Height)
    {
    string windowAttribs;
    windowAttribs = "dialogHeight: "+Height.ToString()+"px; dialogWidth: "+Width.ToString()+"px;edge: Raised; center: Yes; help: No; resizable: No; status: No; scroll:No;";
    string strscript="<script language='javascript'>\n";
    strscript += "window.showModalDialog('"+YesURL+"','','"+windowAttribs+"');\n";
    strscript += "</script>";
    if(!mypage.IsStartupScriptRegistered("ConfirmMsg"))
    mypage.RegisterStartupScript("ConfirmMsg", strscript);
      

  2.   

    var newwin = window.showModelessDialog("../Common/Error.aspx",message,"DialogHeight:300px;DialogWidth:450px;status:0;");