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.0Entities.Modules.PortalModuleBaseEntities.Modules.PortalModuleBase
Previous
 
Next
New Post
9/24/2007 5:05 AM
 

Hou can I use Entities.Modules.PortalModuleBase in an aspx page? Or is ther other way of getting the module setings values in a aspx page? Thanks


Portugal
 
New Post
9/25/2007 1:20 AM
 

For the most part - you cant and your shouldnt.

Much of the context that is DNN is handled by default.aspx - if you call any other .aspx page then you need to handle thay context yourself.

Let me explain - for there to be MODULE SETTINGS - you need to be within the context of a module.
For a module to exist it needs to reside within the context of a CONTAINER and inside a SKIN and the DNN framework.

Simply opening an .aspx page on your website will do none of these things.

So for the most page - you cant get 'Module Settings" from an aspx page ... since they dont really exist.

If however, you want a special .aspx page that has access to the FRAMEWORK if not a specific module

Then you could base your aspx page on:

       DotNetNuke.Framework.PageBase

This will provide you with access to the DNN context.

Westa

 
New Post
9/25/2007 4:39 AM
 

Thans. I'm now using DotNetNuke.Framework.PageBase but how can I get CType(ModuleSettings("var"), String) to work?

I tried CType(DotNetNuke.Entities.Modules.UserModuleBase.GetSetting(Me.PortalSettings.PortalId, "reposit") but didn't work...

 

Thanks again.


Portugal
 
New Post
9/25/2007 9:57 PM
 

As Westa indicated, it really doesn't make sense to reference module settings outside of the context of a DNN module control (derriving from PortalModuleBase) or perhaps from within a server control or user control that is a child control of a DNN module control.  Module settings are stored within the DNN database keyed by ModuleID and SettingName.  Without having a valid ModuleID (or TabModuleID in the case of TabModuleSettings) available within the context of a DNN module, DotNetNuke.Framework.PageBase does not provide a ModuleSettings property like Entities.Modules.PortalModuleBase does.

There are several ways in which ModuleSettings can be obtained outside of the context of a DNN module - primarily for use when creating a server control or user control.  One of them is to use the shared (static) method 'GetModuleSettings' of the DotNetNuke.Entities.Portals.PortalSettings class:

Dim ModuleSettings As System.Collections.Hashtable = PortalSettings.GetModuleSettings (ModuleID)

Note that GetModuleSettings requires you to provide a ModuleID which you will not have available in the context of an .aspx page. Please provide us with more information as to why you need to create an .aspx page rather than a DNN module (.ascx control).


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
9/26/2007 5:13 AM
 

I need a new aspx page do use this:

                    Dim webClient As New WebClient
                    Dim buffer As Byte() = webClient.DownloadData(url)
                    Dim objMemoryStream = New MemoryStream(buffer)
                    Response.Clear()
                    Response.AddHeader("Accept-Header", objMemoryStream.Length.ToString)
                    Response.ContentType = "application/pdf"
                    Response.OutputStream.Write(objMemoryStream.ToArray, 0, Convert.ToInt32(objMemoryStream.Length))
                    Response.Flush()

to open a pdf file in that page. And for that I need a setting stored in dnn database.


Portugal
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Entities.Modules.PortalModuleBaseEntities.Modules.PortalModuleBase


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