简体   繁体   English

如何导航到DNN中的模块?

[英]How to navigate to a module in DNN?

I create a DNN module and add it in module lists. 我创建一个DNN模块并将其添加到模块列表中。 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?! 还是我的错误在哪里?

Have you added the module to a page using Modules - Add Module ? 您是否已使用Modules-Add Module模块添加到页面中?

在此处输入图片说明

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. 如果将模块添加到页面,则可以使用DotNetNuke.Common.Globals.NavigateUrl不同重载来构建模块不同控件的URL。 Besides being a convenient helper, Globals.NavigateUrl uses the friendly url provider to format the url correctly. 除了是方便的帮手之外, Globals.NavigateUrl使用友好的URL提供程序来正确设置URL格式。

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. 实际上,“ parameter”是通过params修饰符params string[] AdditionalParameters传递给形式参数的,该参数可以采用字符串或数组格式的可变数量的参数。

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. 仅当您要从模块中的另一个控件返回到默认视图控件时,才使用没有控件键或querystring参数的重定向到this.TabID通常才有意义。

See also 也可以看看

DotNetNuke Wiki - Module navigation DotNetNuke Wiki-模块导航

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM