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

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesChild Portal PortalSettings.PortalId returns id of parent portalChild Portal PortalSettings.PortalId returns id of parent portal
Previous
 
Next
New Post
3/3/2014 3:11 PM
 

I am building a custom module for DNN version 7.02.01.  I have a simple web handler page and I am trying to set the portalid to a javascript variable in HTML. The module is written in C#.  I have tried these two ways:

 PortalModuleBase pmb = new PortalModuleBase();

int portalid = pmb.PortalId;

and:

DotNetNuke.Entities.Portals.PortalSettings ps = (DotNetNuke.Entities.Portals.PortalSettings)HttpContext.Current.Items["PortalSettings"];

int portalid = ps.PortalId;

Both methods return the portalid of the Parent portal.  I need the portalId of the current Child Portal.

Please help.  Thank you.

 
New Post
3/4/2014 5:30 PM
 
I think your problem is that you don't identify the child portal context - when DNN get's a request it checks to see what portal it is. It does so via checking the page name (or tabid) - if it can't find those in the request it assumes that the request is for the default portal. It does this so it can see if a user is moving between portals so it can invalidate and refresh their security credentials i.e. I might be an admin in "child1" but only a normal user in "child2" and if I am on mysite.com/child1/somepage and then browse to mysite.com/child2/someotherpage, DNN needs to recognise the change of portal and reload the security credentials otherwise the user would become admin in both sites, which would be wrong. Please ensure that your request is being made to a page within the correct childportal.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
12/20/2014 2:21 PM
 

Cathal,

First of all, your reply in my other thread for getting the portal settings GUID is golden.  Solved my issue.  But now I'm running into this same issue I'm replying to here.

 I MUST have the Child Portal PortalID and NOT the Parent PortalId.   I can't get the correct portal settings context without it.

How does one get the Child Portal Portal ID regardless of the role that is accessing it?  For my purposes it isn't an Admin Issue on one child portal vs. regular user on another.

Thanks!

Mike Durthaler

 
New Post
12/21/2014 3:38 PM
 
sorry Mike, i dont quite understand the question, could you give an example of what you're trying to do (e.g. pseudo-code)

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesChild Portal PortalSettings.PortalId returns id of parent portalChild Portal PortalSettings.PortalId returns id of parent portal


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