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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...PortalId is NULLPortalId is NULL
Previous
 
Next
New Post
1/17/2008 7:14 PM
 

Hey all,

I am using the latest DNN upgrading an older version to the latest. All in all it has been a relatively smooth migration from .NET 1.1 older DNN to the latest DNN with .NET 2.0. The problem I am having has been running me in circles for a few hours now.

I have my custom modules that extend "DotNetNuke.Entities.Modules.PortalModuleBase" and my cusom controls that extend "DotNetNuke.Framework.UserControlBase".

All seem to work fine under normal usage (non-AJAX). Here is the problem. I am using AJAX.NET and in the older version all works perfectly. In the latest version here is what happens. On a normal page load if I set a break point "PortalId" will have the correct portal id. When an AJAX call comes in "PortalId" will be NULL if my AJAX call comes in on a module extended page. If the AJAX call comes on a UserControl, PortalId is populated correctly. Is there anything anyone has came across similar to this??? I have been trying different things for hours now and i just can't see to figure out why the AJAX calls from controls work fine, yet calls from modules are undefined.

Thanks in advance

 
New Post
1/21/2008 11:33 AM
 

BUMP!!

 
New Post
2/4/2008 11:37 AM
 

ANYONE??? I am still having this problem. Until I figure this out I am stuck on a super old version of DNN which makes my life a nightmare. Any help, insight, or suggestions are greatly appreciated!

 

Thanks

 
New Post
2/7/2008 2:58 PM
 

I have spent some more hours looking into this, and in fact something is different when the AJAX requests come in. I debugged the DNN code, and in the PortalController.vb function GetCurrentPortalSettings() HttpContext.Current.Items seems to be different on a regular request compared to AJAX request.

 

This is the AJAX request

HttpContext.Current.Items    Count = 6    System.Collections.IDictionary {System.Collections.Hashtable}
    ["AspSession"]    {System.Web.SessionState.HttpSessionState}   
    ["CheckedUsersOnlineCookie"]    "true"   
    ["UserInfo"]    {DotNetNuke.Entities.Users.UserInfo}   
    ["UrlRewrite:OriginalUrl"]    "http://localhost/DNN/ajax/ASP.desktopmodules_tester_controls_messagerecordercontrol_ascx,App_Web_trobdj-6.ashx?_method=GetMessageStatusUpdate&_session=r"   
    ["AspSessionIDManagerInitializeRequestCalled"]    true   
    ["httprequestfilter.attemptedinstall"]    true   

 

Now this is the regular request.


HttpContext.Current.Items    {System.Collections.Hashtable}    System.Collections.IDictionary
    Items    {Length=8}    System.Collections.KeyValuePairs()
        (0)    True {Boolean}   
        (1)    {DotNetNuke.Entities.Users.UserInfo}   
        (2)    True {Boolean}   
        (3)    {DotNetNuke.Entities.Portals.PortalSettings}   
            Key    "PortalSettings" {String}    Object
            Value    {DotNetNuke.Entities.Portals.PortalSettings}    Object
        (4)    "http://localhost/DNN/Home/tabid/36/Default.aspx"   
        (5)    {System.Web.SessionState.HttpSessionState}   
        (6)    {DotNetNuke.Services.Personalization.PersonalizationInfo}   
        (7)    "true"   

 

Most obvious thing here is the size difference. And on the AJAX request the missing of "PortalSettings" in the items is ultimatrely the problem. Also it appears that one is a IDictionary<Hastable> and the other is IDictionary<KeyValuePair>. I have searched to try and see where this could be set, and I only found one place taht was not what i was looking for. Can anyone please help???

 
New Post
3/4/2008 3:26 PM
 

This is DNN 4.8.0

Appearantly this is too deep for most of the people here????

Anyhow, I'd like to hear from a Core developer on the new information I have found.

My last post was correct in that the 2 items missing from my AJAX request are Context.Items["PortalSettings"] and Context.Items["Personalization"]

These are not getting set from one of the modules. The one I am particularly concerned with is the "PortalSettings". I dug into the HttpModules (specifically UrlRewriteModule) and found these lines that are causing that not to be set.

If PortalId = -1 Then
    If Not Request.Url.LocalPath.ToLower.EndsWith(glbDefaultPage.ToLower) Then
        ' allows requests for aspx pages in custom folder locations to be processed
        Exit Sub

 This is in UrlRewriteModule.vb LINE 422, which exits the method since my AJAX request ends with .ashx and not default.aspx, so does not go on to set the following on LINE 460

app.Context.Items.Add("PortalSettings", _portalSettings)

What to do? I need to be able to access the PortalSettings class from my AJAX requests. I have tried to disabled friendly URL's and it hasn't changed the end result. ANYONE have ANY ideas???

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...PortalId is NULLPortalId is NULL


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