how do i navigate from one control to another in a module in dotnetnuke

I am developing a module in dotnetnuke.
It has controls as EditModulename.ascx,ViewModulename.ascx and New1.ascx.
This module is on home page, when i run this it shows the ViewModulename.ascx control on home page.
Now i have one link button cmdL1, I want to display a New1.ascx control after clicking on cmdL1 button. How can i do this?

I tried as follows but it didn't work. it gives "Property evaluation failed" exception.

Thank You.
<asp:LinkButton ID="cmdL1" runat="server" Font-Size="X-Small"
                        CausesValidation = "false" 
                        ForeColor="Red">New Order</asp:LinkButton>
      Protected Sub cmdL1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdNewOrder.Click
            Dim HKTabId As Integer
            Dim hkModuleID As Integer
            Dim objModules As New ModuleController
            Dim HK_Module As ModuleInfo = objModules.GetModuleByDefinition(PortalSettings.PortalId, "HK")
            If HK_Module Is Nothing Then
                Exit Sub
                HKTabId = HK_Module.TabID
                hkModuleID = HK_Module.ModuleID
            End If
                'Response.Redirect(NavigateURL(PortalSettings.ActiveTab.TabID) & "mid=" & hkModuleID")
                Dim ReturnUrl As String = HttpContext.Current.Request.RawUrl
                If ReturnUrl.IndexOf("?returnurl=") <> -1 Then
                    ReturnUrl = ReturnUrl.Substring(0, ReturnUrl.IndexOf("?returnurl="))
                End If
                ReturnUrl = HttpUtility.UrlEncode(ReturnUrl)
                If HKTabId <> -1 And Request.QueryString("override") Is Nothing Then
                    ' user defined tab
                    Response.Redirect(NavigateURL(HKTabId, "returnurl=" & ReturnUrl), True)
                    ' portal tab
                    If HKTabId <> -1 Then
                        Response.Redirect(NavigateURL(HKTabId, "New1", "mid=" & hkModuleID, "returnurl=" & ReturnUrl), True)
                        Response.Redirect(NavigateURL(HKTabId, "New1", "mid=" & hkModuleID, "returnurl=" & ReturnUrl), True)
                    End If
                End If
            Catch exc As Exception    'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub

Open in new window

Who is Participating?
erw13nConnect With a Mentor Commented:
Try use editurl and not navigateurl

Response.Redirect(EditURL("New1", "mid=" & hkModuleID, "returnurl=" & ReturnUrl), True)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.