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

Sort:
You are not authorized to post a reply.
Page 2 of 2 << < 12





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





      Ana, for now, you'll need to continue to use Globals.NavigateURL until we can expose the DependencyProvider 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 PageBase instead of 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).

      DNN partner specializing in custom, enterprise DNN development https://engagesoftware.com/showcase





      Advanced Member





        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!

        DNN partner specializing in custom, enterprise DNN development https://engagesoftware.com/showcase





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

           

           






          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)

             

             

             

             

            You are not authorized to post a reply.
            Page 2 of 2 << < 12

            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:

            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