Link to home
Start Free TrialLog in
Avatar of madhav_ghatole
madhav_ghatoleFlag for India

asked on

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

I am developing a module HK 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 error
as below

Error: New is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: Unable to cast object of type 'ASP.desktopmodules_hk_new1_ascx' to type 'DotNetNuke.Entities.Modules.PortalModuleBase'. ---> System.InvalidCastException: Unable to cast object of type 'ASP.desktopmodules_hk_new1_ascx' to type 'DotNetNuke.Entities.Modules.PortalModuleBase'. at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings PortalSettings) --- End of inner exception stack trace ---
Thank You.
Protected Sub cmdL1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdL1.Click
            Dim objModules As ModuleController = New ModuleController
            Response.Redirect(NavigateURL(PortalSettings.ActiveTab.TabID, "New1", "mid=" & CStr(ModuleId)))
        End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of techExtreme
techExtreme
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of madhav_ghatole

ASKER

I have already given key "New1" to the control New1.ascx
and tried

            Response.Redirect(Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "New1", "mid=" & CStr(ModuleId)))

But it gives error as below, how can I solve this?
Screen.jpg
aww I was expecting an 'A'  however, note that you have a error on the page, which says one or more module did not load. Get rid of that error and you should be fine.