Search code examples
c#asp.netdotnetnukedotnetnuke-module

Open DotNetNuke Link Popup


How can I open module content in a popup instead of a new page?

Currently, I am using a link inside a GridView like this:

<asp:GridView ID="grdStudentAttendanceList" runat="server" AutoGenerateColumns="False" EnableViewState="false">
    <AlternatingRowStyle BackColor="White" />
    <Columns>
        <asp:TemplateField HeaderText="Surname" >
            <ItemTemplate>
                <a href='<%# DotNetNuke.Common.Globals.NavigateURL("AddOrUpdateStudent","StudentID=" + Eval("StudentID").ToString(),"mid=" + ModuleId) %>' class="">
                    <%# Eval("Surname").ToString()%>
                </a>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>

Solution

  • I found a solution for my question and it was very simple.

    Just pass NavigateURL to dnnModal.show like this:

    <asp:TemplateField HeaderText="Surname" >
        <ItemTemplate>
            <a href="javascript:dnnModal.show('<%#DotNetNuke.Common.Globals.NavigateURL("AddOrUpdateStudent","StudentID=" + Eval("StudentID").ToString(),"mid=" + ModuleId) + "?popUp=true" %>',false,550,950,true)" class="">
                <%# Eval("Surname").ToString()%>
            </a>
        </ItemTemplate>
    </asp:TemplateField>
    

    Note: The addition of the ?popUp=true URL query parameter.