2012-07-20 57 views
0

我打開窗口(search.aspx)使用下面的代碼。 我在search.aspx中添加按鈕 當我從btnAdd點擊事件插入記錄,然後打開另一個窗口。 插入記錄後,我必須關閉該窗口。我怎樣才能做到這一點。btnAdd點擊事件後添加記錄打開兩個窗口

 //calling Search.aspx on button click of abc.aspx 
     if (window.showModalDialog) { 
     window.showModalDialog("Search.aspx","name", 
     "dialogWidth:255px;dialogHeight:250px"); 
     } 
     //Search.aspx code behind 
     protected void btnAdd_Click(object sender, EventArgs e) 
     { 

      //Insert query for adding record 
     } 

//Search.aspx code 
$(document).ready(function() 
     { 
      $("input[id$='btnAdd']").live('click', function (e) 
      { 
       if ($(".csstablelisttdselected").length == 0) 
       { 
        alert("Select patient to fixed appointment."); 
        return false; 
       } 
       else 
       { 
        hidPID.value = $('table td.csstablelisttdselected:first').text();     
       } 
      }); 
     }); 

    <asp:Button ID="btnAdd" Width="110px" CssClass="cssbutton" runat="server" Text="Add" 
        OnClick="btnAdd_Click" /> 
+0

你在哪裏上search.aspx負載或其他頁面上打電話給你'window.showModalDialog'代碼? – yogi 2012-07-20 12:02:12

+0

在另一頁按鈕上點擊我打電話給window.showModalDialog – John 2012-07-20 12:03:37

+0

這個按鈕是一個簡單的HTML輸入按鈕,或者您將該頁面發佈到服務器並手動將此腳本注入到您的頁面? – yogi 2012-07-20 12:20:02

回答

1

簡單的模式窗口把這個給<HEAD>

<BASE target="_self"> 
相關問題