我在JS中用showModalDialog弹出的对话框为什么点了里面的按钮后 就会重新打开一个浏览器窗口来显示本页啊!!!!!!!

解决方案 »

  1.   

    在页面中加上
    <base target="_self">
      

  2.   

    试试这个:
    <base target="_self">
      

  3.   

    Page.RegisterStartupScript("","<Script>window.showModalDialog ('..2.aspx');window.location.href = window.location.href;</Script>");
      

  4.   

    还有就是我怎么样得到一个服务器控件的值啊   比如我要得到 Label1的  TEXT值!!!!!!!!
      

  5.   

    <base target="_self">  这句话加在那里啊?
      

  6.   

    这个和.net没有关系,去看看html 参考要得到label的值你直接写labelid.Text就可以了
      

  7.   

    Page.RegisterStartupScript("","<Script>window.showModalDialog ('..2.aspx');window.location.href = window.location.href;</Script>");
      

  8.   

    to  :yifanwu(逸凡)要得到label的值你直接写labelid.Text就可以了 直接写好象不行啊!!
      

  9.   

    我是要在JS中得到 label.text  值啊。。
      

  10.   

    window.document.getElementById("YourLabelID").innerText
      

  11.   

    最好将弹出的页面嵌套在一个 html 页面中。
      

  12.   

    <HTML>
    <HEAD>
    <title>供货通知单管理</title>
    <base target="_self">   <!--加在这里-->
    <meta http-equiv="pragma" content="no-cache"> <!--每次打开窗口清除缓存-->
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    <meta content="C#" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
      

  13.   

    楼主仔细看看我上面的代码,除了加<base target="_self">   以外还要注意在每次打开窗口的时候清除缓冲