简体   繁体   中英

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

I create a module in DNN 7, which have 10 controls. 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. I used this code : 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["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

Edit: To get the control's URL, you can use NavigateURL with the control's key:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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