DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Upgrading from 9.1.1 to 9.4.4 and Globals.NavigateURL

 14 Replies
 0 Subscribed to this topic
 26 Subscribed to this forum
Sort:
Page 2 of 2 << < 12
Author
Messages
New Around Here
Posts: 0
New Around Here

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.

Advanced Member
Posts: 159
Advanced Member
MVP
MVP
You're an MVP!

Ana, for now, you'll need to continue to use <code>Globals.NavigateURL</code> until we can expose the <code>DependencyProvider</code> everywhere.

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 <code>PageBase</code> instead of <code>Page</code>.

In terms of generating URLs outside of a module, use the overload of <code>Globals.NavigateURL</code> that takes a <code>PortalSettings</code> and provide it a <code>PortalSettings</code> that was initialized with a <code>PortalAliasInfo</code>. Alternatively, <code>PageBase</code> exposes the current <code>PortalSettings</code> 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).

Advanced Member
Posts: 159
Advanced Member
MVP
MVP
You're an MVP!

I wanted to follow up now that DNN 9.6.1 has been released.  It includes dependency injection support for the scheduler, so your <code>SchedulerClient</code> implementation can now take a constructor dependency on <code>INavigationManager</code> and it will be provided automatically by the framework. Hope it helps!

Mac
New Around Here
Posts: 9
New Around Here

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:"

 

 

Mac
New Around Here
Posts: 9
New Around Here

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)

 

 

 

 

Page 2 of 2 << < 12

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved