Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Simple Module Code Question - Redirects?Simple Module Code Question - Redirects?
Previous
 
Next
New Post
7/3/2012 4:03 PM
 

I have a page at  [....]/Profile.aspx on my site. I have a module that I am writing that lives on another page. In that module I want to redirect to this Profile.aspx page under a certain condition.

What is the DNN standard one liner to do this? Does it have something to do with "Response.Redirect(Globals.NavigateURL(TabId));" ?

I don't care about tabIDs. Heck, in this case, I don't even care about the Portal for our site as it is very, very basic and has one portal. I just want to be able to call out to the page ASPX name without having to generate the rest of the URL preceding that. That way if the location of the site changes then I won't have to rewrite the redirect call, of course.

I was hoping to use something like:

Response.Redirect(Globals.DNNBaseURL + "Profile.aspx")

Thanks!

 
New Post
7/3/2012 5:26 PM
 

This will give you what you need (in this example, the current user's profile is linked to):

DotNetNuke.Common.Globals.UserProfileURL(ModuleContext.UserID)


Chris Paterra

Get direct answers to your questions in the Community Exchange.
 
New Post
7/3/2012 5:38 PM
 

Hi Chris,

Thank you for the reply! That actually worked for the default profile settings. However, I believe I should have used a better example when describing my problem other than the profile.aspx example.

I really would like to see if there is a standard DNN way to simply reference ANY .aspx page without worrying about the base URL of the website. So say I created a page with the page creation tool called Kittens.aspx and put pictures of kittens on there. If I wanted another module elsewhere in the site to simply redirect to that aspx page, how would I do that? Do I simply use the .NET framework's BaseURL stuff?

 
New Post
7/3/2012 5:48 PM
 

If you are not using one of the built-in set pages (home, user profile, search, etc.; the ones you can set from site settings) your best option is to use NavigateURL and pass it the proper tabid. 


Chris Paterra

Get direct answers to your questions in the Community Exchange.
 
New Post
7/3/2012 5:50 PM
 
I guess I am just too new to DNN and Module creation in general. I am not even sure what the TabID is for this page I created. Any way I could, in turn, pull the TabID somehow by specifiying the .aspx page name?
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Simple Module Code Question - Redirects?Simple Module Code Question - Redirects?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out