楠影

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::
Master.aspx

 <script language="javascript">
  function cwin()
  {  
      var action = window.confirm("are you sure delete?");
      if(action)
      {
       URL="ModalDialogForm.aspx";
       var returnValue = window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:320px;dialogHeight:300px;");
       if(returnValue != null)
       {
        document.all("hidvalue").value = returnValue;
        return true;
       }
       else
           return false;
   }
   else
       return false;
  }
    </script>
    <base target="_self" /> 


ModalDialogForm.aspx

<base target="_self"/>

 protected void btnSubmit_Click(object sender, EventArgs e)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            string returnvalue = this.txtModalDialog.Text.Trim();

            string mfstr = "<script>\n";
            mfstr += "window.returnValue='" + returnvalue.Replace("'", "\'") + "'\n";
            mfstr += "window.close()\n";
            mfstr += "</script>\n";
            if (!IsClientScriptBlockRegistered("mfscript"))
            {
                this.RegisterClientScriptBlock("mfscript", mfstr);               
            }
        }

posted on 2007-10-08 23:02  楠影  阅读(146)  评论(0)    收藏  举报