Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在c语言中,如果对话框中发生任何事件,则关闭该对话框#_C#_Asp.net - Fatal编程技术网

C# 在c语言中,如果对话框中发生任何事件,则关闭该对话框#

C# 在c语言中,如果对话框中发生任何事件,则关闭该对话框#,c#,asp.net,C#,Asp.net,实际上,我在页面中有一个网格(主页),如果用户单击网格(主页)中的链接,它将显示一个与另一个网格的对话框(“detailsgrid”带有编辑、更新和取消选项)。 现在问题是, 该对话框显示网格(detailsgrid),但如果单击“编辑”按钮,它将关闭。再次单击链接后,该对话框将以编辑模式显示网格 如果我在网格(detailsgrid)内的文本框中更改文本,它将再次关闭 未激发detailsgrid\u onRowUpdate事件 我在不同的div控件中设计了这两个网格。如果我把它放在同一个di

实际上,我在页面中有一个网格(主页),如果用户单击网格(主页)中的链接,它将显示一个与另一个网格的对话框(“detailsgrid”带有编辑、更新和取消选项)。 现在问题是,

该对话框显示网格(detailsgrid),但如果单击“编辑”按钮,它将关闭。再次单击链接后,该对话框将以编辑模式显示网格

如果我在网格(detailsgrid)内的文本框中更改文本,它将再次关闭

未激发detailsgrid\u onRowUpdate事件

我在不同的div控件中设计了这两个网格。如果我把它放在同一个div控件中(两个网格将在对话框中逐个显示),它就可以正常工作

我的代码

function ShowDialog(subtitle) {
       $("#dialog").dialog({
            autoOpen: false,
            hide: "puff",
            show: "slide",
            width: "70%",
            title: subtitle,
            modal: true,
            close: function(event, ui) {
                $("#dialog").find("form").remove();
                $("#dialog").dialog('destroy');

            }
        });
        $("#dialog").dialog("open");

    }
然后,我将在homegrid_row命令中绑定detailsgrid

Homegrid_row命令

protected void HomesGrid_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            GridViewRow row = HomeGrid.Rows[Convert.ToInt32(e.CommandArgument)];
            if (row != null)
            {
                var username = row.Cells[1].Text;
                if (e.CommandName == "Details")
                {
                    DetailsGrid.Visible = true;
                    DetailsGrid.DataSource = page2.GetDetails(username);
        DetailsGrid.DataBind();
                    DetailsGrid.Visible = true;
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyFun1", "javascript:ShowDialog(" + "'Details Of " + username + "');", true);
                }
            }
        }
        catch (Exception ex) { }
    }
protected void DetailsGrid_RowCommand(object sender, GridViewCommandEventArgs e)
    {

    }
DetailsGrid_row命令

protected void HomesGrid_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            GridViewRow row = HomeGrid.Rows[Convert.ToInt32(e.CommandArgument)];
            if (row != null)
            {
                var username = row.Cells[1].Text;
                if (e.CommandName == "Details")
                {
                    DetailsGrid.Visible = true;
                    DetailsGrid.DataSource = page2.GetDetails(username);
        DetailsGrid.DataBind();
                    DetailsGrid.Visible = true;
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "MyFun1", "javascript:ShowDialog(" + "'Details Of " + username + "');", true);
                }
            }
        }
        catch (Exception ex) { }
    }
protected void DetailsGrid_RowCommand(object sender, GridViewCommandEventArgs e)
    {

    }

这里的问题是什么?

您使用的是引导对话框吗?听起来您遇到了
回发
问题,只是一个瞎猜,但值得检查。是的,我使用的是引导对话框。您可以向我们展示您的row_命令和aspx代码吗?@Chirag我用row_命令更新了我的问题