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/10/2007 10:31 AM
 

I didn't notice the parenthesis in: module.tostring() was missing, but fixed and still no luck storing values.

Seems like this module follows a different storing method than Westa suggested. I would like to know which way is easiest & most effective.
Here is the code that relates to storing moduleID and userID:

Imports DotNetNuke
Imports System.Web.UI
Imports System.Collections.Generic
Imports System.Reflection
Imports System.Data.SqlClient
Imports DotNetNuke.Security.PortalSecurity

Namespace YourCompany.Modules.ModuleName
Partial Class ViewModuleName
Inherits Entities.Modules.PortalModuleBase
Dim ModuleNameInfo_data As New ModuleNameInfo

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

ShowData(txtSearch.Text)

If IsInRole("Registered Users") Or IsInRole("Administrators") Then

Add_My_Listing_LinkButton.Enabled = True

Else

Add_My_Listing_LinkButton.Text = "You must be a Registered User to add a Listing"

Add_My_Listing_LinkButton.Enabled = False

End If

If Not Page.IsPostBack Then

ShowData("")

End If

End Sub

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


I will be trying your suggested code above and respond with what I find.
In the meantime, any light you can shed on this is appreciated.

-machina12

 
New Post
8/13/2007 10:19 PM
 

Hmm ... ok ... can you please try something

Before page_load can you declare a local variable

public myModuleId1 as integer = moduleid
privatec myModuleId2 as integer = moduleid
protected myModuleId3 as integer = moduleid

in the Page_Load

can you test to see what value myModuleId1, myModuleId2, myModuleId3 and moduleid contain

And then trying the same inside your Handles ObjectDataSource_ModuleName.

What I guessing is that there are some property protection issues going on between the contect that is part of the DNN framework and this FormView control you are trying to use.

Basically the scope of the handles FormView1.ItemInserting event method cannot see the DNN scope.

And the same thing is happened in the ObjectDataSounce_ModuleName.

 
New Post
8/15/2007 12:32 PM
 



It looks like you have a firm understanding of why the module ID is not being stored.
I input code as informed, but was unclear about how to: "test to see what value myModuleId1, myModuleId2, myModuleId3 and moduleid contain"

It is the FormView1.ItemInserting event that is having issues.  ModuleID and Entities is not declared.

 

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 test and complete communication to database using your method?
or
How do I declare ModuleID and Entities, so database recieves information?

Whatever you think is easier.

-machina12

 

 
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