<script language="javascript">
function aaa(){
var retValue= window.showModalDialog("a.aspx?id=111");
if (retValue!=null)
    document.all.TextBox1.value=retValue;
}
</script>

解决方案 »

  1.   

    Button1.Attributes.Add("onclick","javascript:aaa()")
    即不用服务器端事件,客户端的点击事件即可处理
      

  2.   

    应该是你的response.write("")里的javascript语句有问题!
      

  3.   

    http://dotnet.aspx.cc/ShowDetail.aspx?id=49ML4AO8-5PB3-4KNY-NJZD-LJOIOXV4M1X4
      

  4.   

    http://xml.sz.luohuedu.net/xml/ShowDetail.asp?id=49ML4AO8-5PB3-4KNY-NJZD-LJOIOXV4M1X4
      

  5.   

    http://expert.csdn.net/Expert/TopicView1.asp?id=2654756
    参考里面的例子
      

  6.   

    加在Page_load中Button1.Attributes["onClick"] = "javascript:return confirm('你确认要删除记录吗?');";
      

  7.   

    我想按照第二个问题的方法写代码,因为还要处理其他程序代码,所以,请问各位,怎么把返回的retValue付给sStr变量呢?
      

  8.   

    调用showmodalDialog只是在客户端进行的动作,所以返回值不能直接返回给服务端,如果你想在服务端处理到,这中间你需要自己把这个值回发给服务器端 
      

  9.   

    例:
    e.Item.Cells[0].Attributes.Add("onclick","window.open('xinxiForm.aspx?idmain="+e.Item.Cells[0].Text+"','','ToolBar=no,width=260,height=200');");
    在'xinxiForm.aspx中:
    string strsql=Request.quryingString.ToString();
      

  10.   

    string script = string.Format("<script>if(ShowSubmitDlg('{0}', '{1}', '{2}')==true)this.location='./DealFirst.aspx?TType=PT&type={3}';else __doPostBack('Link_Del','');</script>",Request.ApplicationPath,activityid,workitemid,type);
    RegisterStartupScript("show",script);这两行代码你可以用一下,我想应该是符合你的要求的,把参数名换掉就OK了,我的也是要的到模态对话框的返回值来决定下一步的……
      

  11.   


    http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/showmodaldialog.asp?frame=true