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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0HttpContext PortalSettings & HTTP Module Development using RewriteUrlHttpContext PortalSettings & HTTP Module Development using RewriteUrl
Previous
 
Next
New Post
12/29/2008 4:13 PM
 

I developed a HTTP module which rewrites URLs using HttpContext.RewritePath.  Today, I added functionality to the module which would change the URL scheme for our site from something like /Wrestling-Shoes.aspx?tabid=69 to /Wrestling/Wrestling-Shoes.aspx?tabid=69.  I have my module working fine, but I receive a DotNetNuke error when I use the URLs where the directory for the page is /Wrestling instead of ~.  The problem is when the PageBase class calls DotNetNuke.Entities.Portals.PortalController.GetCurrentPortalSettings(); that function is returning a Null reference rather than the expected PortalSettings object.  The stack trace for the error is at the bottom of this post.

Here are my questions:

  • Why would HttpContext.Items("PortalSettings") be a null reference just because the directory changed?  The tabid for the page hasn't changed at all and when I call RewritePath(), I've tried to pass in "/Default.aspx" and "/Wrestling/Default.aspx" with no luck.  The code would be serving 1 request on 1 thread, so I'm not sure why this would be Null to begin with?
  • Where is HttpContext.Items("PortalSettings") set in the code?  I've searched the DotNetNuke.Library and DotNetNuke.HttpModules projects and I can't find the origin of this object.  Maybe if I know when that is set, I can adjust my code?

DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object.at DotNetNuke.Services.Localization.Localization.GetEnabledLocales() in C:\Inetpub\Dnn4\Dnn490\Library\Components\Localization\Localization.vb:line 924 at DotNetNuke.Framework.PageBase.get_PageCulture() in C:\Inetpub\Dnn4\Dnn490\Library\Components\Framework\PageBase.vb:line 120 at DotNetNuke.Framework.PageBase.OnInit(EventArgs e) in C:\Inetpub\Dnn4\Dnn490\Library\Components\Framework\PageBase.vb:line 260 at System.Web.UI.Control.InitRecursive(Control namingContainer)at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 
New Post
12/30/2008 6:04 PM
 

Hi Bryan,

Nice store. I am currently scheduling for the same url rewrite problem, but we will first build a sitemap to monitor what Live and Google think about the data. I have contacted Bruce Chapman of Ifinity. But he is very busy right now. I think your url can be better by using - instead of '+' and you should get ride of the parentid and tabid's as well. I suggest you would take out the inline css and <p>'s and table class="MenuTable" with urls' that can't be indexed.

Is this shop tailor made based on DNN store or ASPnetstorefront (seen on the checkout functionality)? We are also going to challenge a kind of dynamic filter like www.wehkamp.nl has. Maybe we can co-work on some issues?

J.

 
New Post
12/31/2008 4:29 AM
 

Hi Bryan,

I forgot to answer your post: did you have a look at the url rewriter code of dnn, bitthebullet or ifinity? they rewrite the tabid as well and must also encounter your behaviour. I haven't dig into this so closely to help you from a coding perspective.

J.

 
New Post
12/31/2008 9:50 AM
 

I looked closely at the code for the URLRewrite module and found that HttpContext.Items("PortalSettings") is set in that HTTP module.  I'm going to dig into this further today, but if anybody knows anything about this topic, please contact me!

As far as the question of what technology is used for my site, we use DotNetNuke as the basis for our code and then every module implemented on our site save the Text/HTML module is custom built in-house.  My rewrite module is just a plain old ASP.Net HTTP Module that uses data stored by DNN modules.  I'm going to be releasing the code for the modules within the next week or 2 depending when I can find time.

 
New Post
12/31/2008 2:32 PM
Accepted Answer 

After digging into the URL rewrite module that comes with DNN, I found that you have to enter the additional directories you're using as portal aliases.  So if I wanted to use /Wrestling/Wrestling-Shoes.aspx as my URL, then I need to setup a portal alias for the site of domain.com/Wrestling for the rewrite module to work.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0HttpContext PortalSettings & HTTP Module Development using RewriteUrlHttpContext PortalSettings & HTTP Module Development using RewriteUrl


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