Hi Brian,
On futher looking into my custom modules and the pages we have, I think, I need a way to form URLs outisde the PortalModuleBase. I have some pages, which directly extend from System.Web.UI.Page, which needs to use NavigateURL. Is there a solution? This is very critical for us to have these pages.
Ana, for now, you'll need to continue to use Globals.NavigateURL until we can expose the DependencyProvider everywhere.
Globals.NavigateURL
DependencyProvider
For your pages, I would suggest that you convert them into DNN pages with modules. But, until you're able to do that, my secondary recommendation is to inherit from DNN's PageBase instead of Page.
PageBase
Page
In terms of generating URLs outside of a module, use the overload of Globals.NavigateURL that takes a PortalSettings and provide it a PortalSettings that was initialized with a PortalAliasInfo. Alternatively, PageBase exposes the current PortalSettings as a property, so I'd recommend using that for your pages instead of creating your own (though you will need to create your own inside the scheduled task).
PortalSettings
PortalAliasInfo
I wanted to follow up now that DNN 9.6.1 has been released. It includes dependency injection support for the scheduler, so your SchedulerClient implementation can now take a constructor dependency on INavigationManager and it will be provided automatically by the framework. Hope it helps!
SchedulerClient
INavigationManager
I have the code working for anyhing that inherits the 'PortalsModulesBase'
However, I do not see inheritence from 'DnnApiController', is that another place you plan to implement or is there a work around to use the new interface from the DnnApiController.
EDIT: I think you answered this in a different post. sorry about that. going to try that method you suggested:
"At a high level, the answer is that you'll request one from the dependency injection container. If you're using MVC controllers or Web API controllers, you can just add a parameter to your controller's constructor and the framework will supply that dependency automatically. Here's a Web API controller example:"
This worked for me using the new Navigation Interface, thanks Brian.
Public Class _Whatever_
Inherits DnnApiController
Private ReadOnly navigationManager As INavigationManager
Public Sub New(ByVal navigationManager As INavigationManager) Me.navigationManager = navigationManager End Sub
....
pageUrl = navigationManager.NavigateURL(ti.TabID)
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.