dotnetnukedotnetnuke-5dotnetnuke-6dotnetnuke-7

Is it possible to programmatically display my custom module version in DNN?


Is there a way in DNN 5, 6 or 7, via the DNN API to programmatically display our custom module version number (the one we set in the module manifest) so that we don't have to manually change it on each new version.

This would be handy so we can be 100% confident of the version our customers use.


Solution

  • Here is a function to help you with that.

    public string GetModuleVersion(string moduleName)
    {
        DesktopModuleController objModules = new DesktopModuleController();
        DesktopModuleInfo info = objModules.GetDesktopModuleByModuleName(moduleName);
        return info.Version;
    }
    

    Example

    string ver = GetModuleVersion( "DigArticle" );