问题:
在用户空件a.ascx中加入一个Button按钮,在单击这个按钮后,执行一系列数据库操作后,转向b.aspx,要定制弹出的b.aspx窗口的大小怎么写代码,谢谢

解决方案 »

  1.   

    window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no')
      

  2.   

    數據庫操作
    window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=n o, status=no')
      

  3.   

    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);
    }
      

  4.   

    这个是模态,现在这个是普通窗口 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);
    }
      

  5.   

    数据库操作
    ,。
    popUpWindow(this,b.aspx,200,200)
      

  6.   

    //*****弹出窗口代码
    function WindowsOptn(varurl,varwidth,varheight)
    {
       var vartop=(screen.width-varwidth)/2;
       var varleft=(screen.height-varheight)/2);   window.open(varurl,"onices","width=400,height=200,left="+varleft+",top="+vartop+"");
    }//****拆行相应功能,调用js函数就可以了三
    Page.RegisterStartupScript("openwindows", "<script>WindowsOptn('selectuser.aspx','600','400');</script>");