public string OpenModalDialog( Page refPage, int DialogHeight, int DialogWidth, string PageUrl, string PageName )
{
string vReturnValue = "";
StringBuilder OpenModalDialogScript = new StringBuilder(); 
OpenModalDialogScript.Append( "<script language=javascript>\n" );
OpenModalDialogScript.Append( "vReturnValue=window.showModalDialog('"+PageUrl+"','_blank','"+PageName+"','dialogHeight: "+DialogHeight+"px; dialogWidth: "+DialogWidth+"px; dialogTop: 150px; dialogLeft: 150px; edge: Raised; center: Yes; help: Yes; resizable: Yes; status: Yes;');" + "\n"); 
OpenModalDialogScript.Append( "</script>" ); 
refPage.RegisterStartupScript( "MsgBox", OpenModalDialogScript.ToString() );
return vReturnValue;
}

解决方案 »

  1.   

    <form name="form1" method="post" action="">
      <input type="button" name="Submit" onclick="window.showModalDialog'login.asp','','width=270,height=150,top=200,left=300');window.close();,'','dialogWidth:0px;dialogHeight:0px');" value="Submit">
    </form>
    试试,你原来的写法很奇怪呀,showmodaldialog里又用window.open,不知是何意
      

  2.   

    可以弹出类似于c/s结构的窗体,大伙都知道showModalDialog弹出的窗体很难看的,