showModalDialog顺序

 function OpenNewForm1()
        
{        
              
var myReturnValue = 0;
              myReturnValue
=window.showModalDialog('sel_job_cq.aspx',[window,document.getElementById("tbVessel").id,document.getElementById("tbVoy").id],"status:Modeless;edge:raised;unadorned:no;scroll=no;resizable:yes;center=yes;help:no;dialogwidth:615px;dialogheight:398px");
              
if(typeof(myReturnValue) != 'undefined')//sel_job_cq.aspx关闭后先执行这里
              
{
                document.form1.hid_hit_choose.value 
= 'hit';
                alert(document.form1.hid_hit_choose.value);
              }

        }
再执行OpenNewForm1()所在的页面(view_job_dcpz.aspx)的Page_Load事件,所以<input id="hid_hit_choose" value="o" runat="server" type="hidden" />一定要runat="server"的,不然,hid_hit_choose的值经过Page_Load后就一直是o而不是document.form1.hid_hit_choose.value = 'hit';
的结果。
 可能是在Page_PreInit 或 Page_PreRender之类的方法里面执行了对aspx页面的html代码的“初始化”,导致hid_hit_choose的值“变成”了o。

posted on 2007-10-24 13:44  simhare  阅读(157)  评论(0)    收藏  举报

导航