Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.

XML
<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>

XML
<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>
Posted
Comments
RelicV 21-Jun-13 5:35am    
Could you check and confirm if the $('a#popup').length is greater than 0 or not.?
Lakshmimsridhar 21-Jun-13 5:56am    
actually its not displaying in the form of dialog but displyaing that agencyprofile.aspx.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900