<!--a.htm--><script language="JavaScript">
<!--
/*@cc_on @*/
/*@if (@_win32 && @_jscript_version>=5)
function window.confirm(strText){
var pWin=window.showModalDialog("b.htm",strText,"dialogHeight:116px; dialogWidth:232px; help: No; resizable: no; status: No; scroll:no; dialogTop:"+(screen.height-116)/2+"px; dialogLeft:"+(screen.width-232)/2+"px;");
}
@end @*/
confirm("真的要删除吗?");
//-->
</script>
<!--b.htm--><html>
<head>
<style type="text/css">
body{ }
td,input{ font-size:12px}
</style>
<script language="JavaScript">
<!--
var str  =  window.dialogArguments;
function doOk(){ window.returnValue="yes"; window.close();}
function doCancel(){ window.returnValue="no"; window.close();}
var timer=null;
function setTimer(){ timer=window.setTimeout("doOk()",3000); }
document.onclick=function (){ document.getElementById("btnOk").focus(); }
document.oncontextmenu=function (){ document.getElementById("btnOk").focus();}
//-->
</script>
<title align="center">--==提示信息==--</title>
</head>
<body style="background-color:buttonface; margin:0" onload="setTimer();">
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
<tr height="65%">
<td width="25%" align="center" valign="center"><img src="warning.gif" style="width:32px; height:32px"></td>
<td valign="middle">
<script language="JavaScript">
<!--
document.write(str);
//-->
</script>
</td>
</tr>
<tr height="35%">
<td colspan="2" align="center" valign="top">
<input type="button" id="btnOk" value="  确定  " onclick="doOk()">
<input type="button" id="btnOk" value="  取消  " onclick="doCancel()">
</td>
</tr>
</table>
</body>
<html>

解决方案 »

  1.   

    a.html中如下方法
    function test()
    {
    var revalue=window.showModalDialog("b.htm","test",300,240,true);
    }
    在b.htmlz中function acptest(retvalue)
    {
        window.returnValue=retvalue;
    }
      

  2.   

    a.aspx////////////<script>
    function mydate()    
    {
      var x=event.screenX, y=event.screenY;             
      var str=window.showModalDialog('clock0.aspx',event.srcElement.value,'dialogleft:'+x+';dialogtop:'+y+';dialogHeight:230px;dialogWidth:190px;help:no;status:no;dialogFormBorderStyle:no');
      if (str!=null)
      event.srcElement.value=str
    }
    </script>a.cs////////////////////////TextBox1..Attributes.Add("onclick", "mydate()");clock0.aspx///////////////////////////////<HTML>
    <HEAD>
    </HEAD>
    <frameset rows="0,*">
    <frame src="about:blank">
    <frame src="clock.aspx">
    </frameset>
    </HTML>clock.cs////////////////////////////using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;namespace QJ
    {
    /// <summary>
    /// clock 的摘要说明。
    /// </summary>
    public class clock : System.Web.UI.Page
    {
    protected System.Web.UI.WebControls.TextBox TextBox1;
    protected System.Web.UI.WebControls.Calendar Calendar1;
    private static string strScript;
    private void Page_Load(object sender, System.EventArgs e)
    {
    // 在此处放置用户代码以初始化页面
    } #region Web 窗体设计器生成的代码
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// 设计器支持所需的方法 - 不要使用代码编辑器修改
    /// 此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {    
    this.Calendar1.SelectionChanged += new System.EventHandler(this.Calendar1_SelectionChanged);
    this.Load += new System.EventHandler(this.Page_Load); }
    #endregion private void Calendar1_SelectionChanged(object sender, System.EventArgs e)
    {
    TextBox1.Text=Calendar1.SelectedDate.ToShortDateString();
    strScript = "<script>" + "\r\n"; 
    strScript += "window.parent.returnValue='" + TextBox1.Text.Replace("'", "\\'") + "'" + "\r\n"; 
    strScript += "window.parent.close()" + "\r\n"; 
    strScript += "</script>" + "\r\n"; 
    if (!IsClientScriptBlockRegistered("clientScript"))
    {
    RegisterClientScriptBlock("clientScript", strScript);
    }
    }
    }
    }