本文介绍了点击gridview链接按钮,它应该在jquery中打开一个模态窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我google它并尝试也没有得到那个对话框。我发布了我的代码。请帮我。它导航到其他形式但不在模态对话框中。



I google it and tried also not getting that dialog form.Below i posted my code. please help me. Its navigation to other form but not in modal dialog.

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
    $(document).ready(function () {
            $('a#popup').live('click', function (e) {

                var page = $(this).attr("href")  //get url of link

                var $dialog = $('<div></div>')
                .html('<iframe style="border: 0px; " src="' + page + '" width="100%" height="100%"></iframe>')
                .dialog({
                    autoOpen: false,
                    modal: true,
                    height: 450,
                    width: 'auto',
                    title: "Agency Profile",
                    buttons: {
                        "Close": function () { $dialog.dialog('close'); }
                                },
                    close: function (event, ui) {

                       __doPostBack('<%= btnRefresh.ClientID %>', '');  // To refresh gridview when user close dialog


                    }
                });
                $dialog.dialog('open');
                e.preventDefault();
            });
        });

    </script>




<asp:GridView ID="Gridorder" runat="server" AutoGenerateColumns="False"

        onrowcommand="Gridorder_RowCommand" >
    <Columns>
        <asp:TemplateField HeaderText="AgnecyId">
            <ItemTemplate>
            <a id="popup" href='Agencyprofile.aspx?id=<%# Eval("AgencyId") %>' > AgencyId</a>
                <%--<asp:LinkButton ID="LnkAgencyId" runat="server" CommandName="Select"
                    CommandArgument='<%# Eval("AgencyId") %>' Text='<%# Eval("AgencyId") %>'></asp:LinkButton>--%>

            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="OrderDate" HeaderText="Date" />
        <asp:BoundField DataField="Orderstatus" HeaderText="Orderstatus" />
        <asp:TemplateField HeaderText="Details">
            <ItemTemplate>
                <asp:Button ID="BtnDetails" runat="server" Text="Details" BackColor="#669999"

                    BorderColor="#FF33CC" BorderStyle="Solid" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Dispatch">
            <ItemTemplate>
                <asp:Button ID="BtnDispatch" runat="server" Text="Dispatch" BackColor="#669999"

                    BorderColor="#FF33CC" BorderStyle="Solid" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
    </asp:GridView>

推荐答案




这篇关于点击gridview链接按钮,它应该在jquery中打开一个模态窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 05:02