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.0User Control only displays in Edit modeUser Control only displays in Edit mode
Previous
 
Next
New Post
2/3/2009 12:14 PM
 

Here's a brain twister for you.

I've developed a custom module that loads different ascx forms at runtime.  The ascx forms can be located anywhere, it doesn't care.  The ascx forms it loads are not listed in the dnn module definitions screen since they are only pages with their own dll but still only pages.

The module works fine when you are logged in as a site administrator, host or registered user.

But if you are an unauthorized user, the ascx form load doesn't happen.  The 'outer' ascx loads fine, but the'inner' ascx, that is the user control being loaded by the outer ascx, does not load.  No errors, just does not appear.  I looked at the html source and there's nothing in the panel where it is normally loaded.

Another indication of what's going on is the View, Edit and Design buttons in the host menu.  If you have Edit pressed, the loaded ascx shows up as normal.  If you press View or Design, it does not.

I went into the module definiton os the host control (the 'outer' user control) and it's set to View rights, with no Key defined.
I changed that to Annoymous and the 'inner' control still does not load when you are not logged in.

Anybody have any ideas on how to overcome this limitation?

If so I thank you in advace.

 
New Post
2/3/2009 1:28 PM
 

Sounds like the Cache Duration has been set to a non-zero value in the module's settings. Try setting it to 0. Also, set the Default Cache Duration to -1 in the module definitions to prevent users from settting the Cache Duration for an instance of the module.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
2/3/2009 1:38 PM
 

Thanks for the suggestion;

The Default Cache was set to 0 but I changed it to -1 and there is no difference.
I know that won't be used until the module is added to the page again, but there is no Cache Duration in the module settings.
I'm running DNN 4.90

 

 
New Post
2/3/2009 1:55 PM
 

Here's another observation.

I added the same module a second time to the same page and then logged out.

The second module shows up and works fine while the first module does not load.

I logged in as Host, and deleted the first module.  Now the second one does not load it's internal ascx.

What on earth could cause that?

 
New Post
2/4/2009 5:38 AM
 

After doing some diagnostics, I saw that the panel control Iwas loading my ascx 'inner' control in had its visibility set to False.  This was set by DNN itself during the Page_Init cycle of my 'outer' control.  It seems that when you are not logged in then it does this.  When you are logged in it does not.  However on form_Load the panel visibiltiy is set to true (again, I don't do this in my code, it's a DNN controlled thing).

So by moving my Load Controls method to Page_Load the problem is solved; unauthorized users can access the form now and controls load fine.  However loading controls dynamically on Page_Load is not best practice; it's better in most cases to load them on Page_Init beause then the controls are in place when the view_state is loaded.  I have to check my other controls I load to see if they are affected adversely by the move, but since they have their own page lifecycle I dont think they will be affected.

So my question is why does DNN turn panel's to not visible at all on page init?  Then to visible anyway on Page Load?

Anybody know?

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0User Control only displays in Edit modeUser Control only displays in Edit mode


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