When working with DotNetNuke I often find it necessary to do a redirection back to the current page, with additional querystring parameters. Not actually switching views, but just back to the same page so that some other action could be taken for a specific module. In the past most of the examples I found used this process.
DotNetNuke.Common.Globals.NavigateUrl(this.TabId) + "?mykey=myvalue"
Which would create a url such as
Although a fully functional URL that works 100%, it is not something that can be easily copied, and overall doesn't look all that fancy. Looking through the functionality of the various NavigateUrl overloads, it didn't seem apparent that there was something that could be used to re-write that type of URL. Well I missed something using the following code.
DotNetNuke.Common.Globals.NavigateUrl(this.TabId, "", "mykey=myvalue")
From this example we provide the tabId, a blank ControlKey, and then our added parameter value. We could add additional parameters as well.
This results in a URL similar to the following.
Now, this is a fully re-written URL, and something much easier for a person to remember. I hope this has been helpful!
, DNN Development