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.0Unique Module ID?Unique Module ID?
Previous
 
Next
New Post
8/6/2007 5:19 PM
 

im sure we are talking about two different things.

If you want to store your moduleId in your own table, just pass me.moduleId to the stored procedure that takes care of the saving. You should NOT generate your own module id, that is generate by dnn AUTOMATICALLY and is available at all times from within your module

Same with user id: that is generated by DNN automatically, and is always available from within the module code as Me.UserId

 


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
New Post
8/6/2007 7:19 PM
 

What exactly is it that your are trying to do.

EVERY module that is instanced from   PortalModuleBase  or  UserModuleBase  inherits  a  property called ModuleId and one call PortalId plus lots of other stuff.

So for starters your MODULE must be declared as something like:

Namespace MyName.MyModules

    Partial Class MyModuleClass
        Inherits DotNetNuke.Entities.Modules.PortalModuleBase

Unless your module is setup this way then the control will not have direct access to the DNN system and context
 - short of you hard coding a whole lot of ugliness.

From inside your module then:

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

                   dim myLocalPortal as Integer = PortalId   ' will have the PortalId
                   dim myLocalPortal as Integer = ModuleId   ' will have the ModuleId

                   dim myUserInfo as UserInfo = Entities.Users.UserController.GetCurrentUserInfo  ' will have the current userinfo

              dim myUserId as Integer = myUserInfo.userId ' will have the current userid

and so on.

You should also possibly try to avoid using the asp.net data access tools - and instead use the DAL or DAL+ approach supported directly by DNN.
While I cant directly recall any conflicts between those elements and DNN - I guess its possible there may be one.

Westa

 
New Post
8/8/2007 10:25 AM
 



Westa,

Aprreciate the information.
Took a look at what you mentioned and it made a bit more sense.
Turns out I already am running the Inherits
Entities.Modules.PortalModuleBase within my .vb file.
I also noticed that I am running a bit of a different style of input to database.  Not sure if it is the data access method, or DAL approach.
The module I am working on is from the AdefWebServer, so it is written well and even covers the setup within tutorial for PortalID, ModuleID & ID.
The only thing I can see is that some of the code is 'not declared', I will mark that in blue.(squiggly errors in editor)

I am using this code:
Protected Sub SetModuleId(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles
ObjectDataSource_ModuleName.Selecting
e.InputParameters(
"ModuleId"
) = ModuleId.ToString
End Sub
 

Protected Sub InsertingItem(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewInsertEventArgs) Handles FormView1.ItemInserting
e.Values.Item(
"UserID"
) = Entities.Users.UserController.GetCurrentUserInfo.UserID
e.Values.Item(
"ModuleId"
) = ModuleId.ToString()
e.Values.Item(
"ID"
) = 0
End
Sub


How do I get these to be declared?



-machina12

 
New Post
8/9/2007 2:20 PM
 

If you have Imports DotNetNuke and you have " Entities.Modules.PortalModuleBase" and you are creating a user control (.ascx) ModuleId.ToString() will work.  



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
8/10/2007 12:26 AM
 

There should be no NEED for any declarations - the moduleid and context is all handle by the PortalModuleBase class.

It really seem like you have the module code setup incorrectly - this stuff just works.

Can you maybe cut and past the top section of your code

From the first line down to the end to the class declaration and implements statement.

Westa

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Unique Module ID?Unique Module ID?


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