Search code examples
c#dotnetnukedotnetnuke-module

Can I force SSL to secure a Dotnetnuke Module Edit Page?


I have a DNN modules where I don't care if the VIEW page does not use SSL.

However, when a module editor loads my modules' EDIT page in the admin template (my module is the only module on the page) I want to load the page securely using SSL, if the site has SSL capability.

Is this possible?


Solution

  • Yes, just put the following at the start of the modules's code behind.

    // Force Page to use SSL if it can.
    if (PortalSettings.SSLEnabled && !Request.IsSecureConnection)
    {
      DotNetNuke.Security.PortalSecurity.ForceSecureConnection();
    }