Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Adding an .aspx files to a module packageAdding an .aspx files to a module package
Previous
 
Next
New Post
11/6/2007 1:43 PM
 

Hello.

I've created a dotnetnuke module which uses a custom aspx page to display a dynamic image. This means I've also created an aspx page that outputs a jpeg image.

I've placed this aspx page at my DNNROOT/CustomPages/displayimage.aspx

Is there a way I could include this file in the package generated by the DNN module package creator? Can I manually add the file to the ZIP and add some entry to the .dnn file inside it?

Thanks in advance for your help.

 
New Post
11/6/2007 5:38 PM
 

Place the aspx file inside your module directory and adjuth your pathes that it searches your images at ~/desktopmodules/yourmodule instead of ~/custompages.
Then you can treat the aspx inside the dnn file like all other files.

 
New Post
11/7/2007 4:11 AM
 

Your solution worked.

Thanks Stefan.

 
New Post
11/13/2007 12:16 PM
 

Stefan Cullmann wrote

Place the aspx file inside your module directory and adjuth your pathes that it searches your images at ~/desktopmodules/yourmodule instead of ~/custompages.
Then you can treat the aspx inside the dnn file like all other files.

More comfortable :


        //  /DesktopModules/CustomModule/ViewCustomModule.ascx.cs
      
        public static string ResolveDesktopModuleUrl(DotNetNuke.Entities.Modules.PortalModuleBase portalModule, string relativePath)
        {
            return ResolveDesktopModuleUrl(portalModule, relativePath, null);
        }

        public static string ResolveDesktopModuleUrl(DotNetNuke.Entities.Modules.PortalModuleBase portalModule, string relativePath, string fileName)
        {
            if (portalModule == null) throw new ArgumentNullException("portalModule");
            return ResolveDesktopModuleUrl(portalModule.ModuleId, portalModule.TabId, relativePath, fileName);
        }

        public static string ResolveDesktopModuleUrl(int moduleId, int tabId, string relativePath, string fileName)
        {
            const string DESKTOP_MODULES_FOLDER_NAME = "/DesktopModules/";

            DotNetNuke.Entities.Modules.ModuleController moduleController = new DotNetNuke.Entities.Modules.ModuleController();
            DotNetNuke.Entities.Modules.DesktopModuleController desktopModuleController = new DotNetNuke.Entities.Modules.DesktopModuleController();

            DotNetNuke.Entities.Modules.ModuleInfo moduleInfo = moduleController.GetModule(moduleId, tabId);
            DotNetNuke.Entities.Modules.DesktopModuleInfo desktopModuleInfo = desktopModuleController.GetDesktopModule(moduleInfo.DesktopModuleID);

            if (string.IsNullOrEmpty(relativePath) == false)
            {
                if (relativePath.StartsWith("/") == false) relativePath = "/" + relativePath;

                if (string.IsNullOrEmpty(fileName) == false)
                {
                    if (relativePath.EndsWith("/") && fileName.StartsWith("/"))
                    {
                        relativePath = relativePath.Remove(relativePath.Length - 1);
                    }
                    else if (relativePath.EndsWith("/") == false && fileName.StartsWith("/") == false)
                    {
                        relativePath += "/";
                    }

                    return Globals.ResolveUrl(DotNetNuke.Common.Globals.ApplicationPath + DESKTOP_MODULES_FOLDER_NAME + desktopModuleInfo.FolderName + relativePath + fileName);
                }

                return Globals.ResolveUrl(DotNetNuke.Common.Globals.ApplicationPath + DESKTOP_MODULES_FOLDER_NAME + desktopModuleInfo.FolderName + relativePath);

            }
            else
            {
                if (string.IsNullOrEmpty(fileName) == false)
                {
                    if (fileName.StartsWith("/") == false)
                    {
                        fileName = "/" + fileName;
                    }

                    return Globals.ResolveUrl(DotNetNuke.Common.Globals.ApplicationPath + DESKTOP_MODULES_FOLDER_NAME + desktopModuleInfo.FolderName + fileName);
                }
            }

            return Globals.ResolveUrl(DotNetNuke.Common.Globals.ApplicationPath + DESKTOP_MODULES_FOLDER_NAME + desktopModuleInfo.FolderName);

        }

       Usage: 

        string pageUrl = ResolveDesktopModuleUrl(this,"SomePage.aspx");
       
        resolved to /DesktopModules/CustomModule/SomePage.aspx

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Adding an .aspx files to a module packageAdding an .aspx files to a module package


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

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

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. 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.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out