2
votes

I am building a custom module for DNN 05.04.02. I want to add a custom action to the module for downloading submitted files. I am able to get the link to appear but the url parameter is a mystery. I have tried dozens of combinations and it either leads me to page not found or a blank page with no errors that is incorrect. The page I want to reach is called Download.ascx and all of the work i have done is based off the Visual Studio DNN Module Template. What am i missing with the url parameter?

From: ViewDataValidation.ascx

public ModuleActionCollection ModuleActions
        {
            get
            {
                ModuleActionCollection Actions = new ModuleActionCollection();
                Actions.Add(GetNextActionID(),
                    "Download Validated Files",
                    "Download",
                    "",
                    "edit.gif",
                    EditUrl("Download"),
                    false,
                    DotNetNuke.Security.SecurityAccessLevel.Admin,
                    true, false);
                return Actions;
            }
        }
1
Figured out the problem was I had to add the User Control to the Module definition and give it a unique key. The link @bdukes provided goes over how to do that. I also edited the code above with my final code. Why does DNN make everything so difficult?ChrisOPeterson

1 Answers

2
votes

Take a look at Joe Brinkman's blog post exploring all of the functionality of the actions. It looks like the URL property is expecting an absolute URL (i.e. something starting with http://).

There's also the option to fire a server-side event, which you can then use to do the redirect manually, if that would be easier.

If you're navigating to an internal page, you might also try passing in the result from calling Globals.NavigateURL(tabId).