1

I create a DNN module and add it in module lists. Now i want to call it, i've tried this:

Response.Redirect(Globals.NavigateURL(this.TabId, "Control Key", "parameter"), true);

but it opens the default page, that is empty!

Where is my module?!?! or where is my mistake?!

maryam mohammadi
  • 694
  • 3
  • 14
  • 27
  • I don't get you, what do you mean by call your module? you need to call one of your module controls? or just add your module on a page? – Ehsan Aug 12 '12 at 07:46

1 Answers1

5

Have you added the module to a page using Modules - Add Module ?

enter image description here

If the module is added to the page, you can use different overloads of DotNetNuke.Common.Globals.NavigateUrl to build urls to the module's different controls. Besides being a convenient helper, Globals.NavigateUrl uses the friendly url provider to format the url correctly.

Response.Redirect(Globals.NavigateURL(this.TabId, "Control Key", "parameter"), true);

This overload redirects to the "Control Key" module control, using "parameter" as an additional querystring parameter. Arguments "Control key" and "parameter" act as placeholders, and should be substituted with proper values.

"parameter" is actually passed to a formal parameter with a params modifier, params string[] AdditionalParameters, that can take a variable number of arguments in a string or array format.

If you want to redirect to the default view control, use the overload

Response.Redirect(Globals.NavigateURL(TabId))

Redirecting to this.TabID without a control key or a querystring parameter usually makes sense only if you want to return to the default view control from another control in the module.

See also

DotNetNuke Wiki - Module navigation

Community
  • 1
  • 1
mika
  • 6,812
  • 4
  • 35
  • 38