简体   繁体   English

如何将控件的url保留在dnn中的模块中?

[英]How to keep controls' url within a module in dnn?

I create a module in DNN 7, which have 10 controls. 我在DNN 7中创建了一个模块,该模块具有10个控件。 These controls call through each other with different parameters. 这些控件使用不同的参数相互调用。 i need to keep the navigation URL of my controls in order to use in "Back" button in each control. 我需要保留控件的导航URL,以便在每个控件的“后退”按钮中使用。 I used this code : Response.Redirect(DotNetNuke.Common.Globals.NavigateURL()); 我使用了以下代码:Response.Redirect(DotNetNuke.Common.Globals.NavigateURL()); but it returns to the very first control of my module. 但它返回到我模块的第一个控件。

How can i have a simple breadcrumb like object within my module which keeps previous control with all its parameters? 我如何在我的模块中有一个像面包屑这样的简单对象,该对象始终保持其所有参数的先前控制权?

You can store the last control and all the parameters in a Session variable: 您可以将最后一个控件和所有参数存储在Session变量中:

Session["LastControlKey"] = "Edit";

...and get the values again using: ...然后使用以下方法再次获取值:

string lastControl = (string)Session["LastControlKey"];

More examples for the session variable on MSDN: http://msdn.microsoft.com/en-us/library/6ad7zeeb.ASPX MSDN上会话变量的更多示例: http : //msdn.microsoft.com/zh-cn/library/6ad7zeeb.ASPX

Edit: To get the control's URL, you can use NavigateURL with the control's key: 编辑:要获取控件的URL,可以将NavigateURL与控件的键一起使用:

DotNetNuke.Common.Globals.NavigateURL(this.TabId, lastControl)

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

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