0

以下のコードを使用してウィンドウ(search.aspx)を開きます。btnAddクリックイベントからレコードを挿入すると、search.aspxにボタンが追加され、別のウィンドウが開きます。レコードを挿入した後、そのウィンドウを閉じる必要があります。どうやってやるの。

       //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" />   
4

1 に答える 1

1

単にモーダルウィンドウでこれを<HEAD>

<BASE target="_self">
于 2012-07-20T12:34:00.803 に答える