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.0Problems in creating a moduleProblems in creating a module
Previous
 
Next
New Post
3/2/2006 10:08 AM
 

Hi all,

I am very new to DNN as well as developing modules for it. I could use some help here. I've read the module developers guide, the tutorial on www.asp.net forum and the tutorial on adefwebserver.com.

I am having problems in the main creation of a module. I am using DNN 4 and Visual Studio 2005.
I've created a module with the help of the starter kit. Now, for testing purposes, I wanted to create a dropdownlist that fetches data form a sql table. the table is created as well as the procedure and the files in the lower layers are also correct (below the UI layer). The problem is in the ViewTestModule.ascx and ViewTestModule.ascx.vb. The template generated a simple asp:label that show some sample data from the database, that works fine. As I mentioned before, I wanted now to create a drop down list that shows the same sample data as the label.

I created the <asp:DropDownList ID="ddlTestCbo" runat="server" /> just below the already existing asp:Label. I went to the ViewTestModule.ascx.vb file and altered a bit the Page_Load method:

ddlTestCbo.DataSource = colTestModule
ddlTestCbo.DataValueField =
"ItemID"
ddlTestCbo.DataTextField = "Content"
ddlTestCbo.DataBind()

Now, the VS05 is telling me that the ddlTestCbo is not declared. So I declared it as
Protected WithEvents ddlTestCbo As System.Web.UI.WebControls.DropDownList

Now the code is "correct". So I try to run the module and I get the following error:

DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at YourCompany.Modules.TestModule.ViewTestModule.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace ---

Then I went back to the .ascx file and at the top I changed  CodeFile="ViewTestModule.ascx.vb" to Codebehind="ViewTestModule.ascx.vb". In the ViewTestModule.ascx.vb file I was allowed to use the ddlTestCbo without declaring it. So I ran the module again, and recieved a new error:

MinMax persistance type of cookie requires a ModuleId

So, I changed back to CodeFile="..." and comented away all of the dllTestCbo. Ran the module and it worked but only with a sample label and an empty DropDownList :(


What am I doing wrong here? I just can't seem to get this stuff working at all and it is starting to get extremely frustrating. If anyone could please help me out, I would be very gratefull!

Thanks in advance

 
New Post
3/2/2006 12:46 PM
 
Two questions:

Are you sure its the ddlTestcbo that is null? what about colTestModule?

Do you have Partial keyword in the Class definition in the CodeFile?



Charles Nurse
Chief Architect
Evoq Content Team Lead,
DNN Corp.

Want to contribute to the Platform project? - See here
MVP (ASP.NET) and
ASPInsiders Member
View my profile on LinkedIn
 
New Post
3/3/2006 3:48 AM
 

Hi, thanks for the reply. I am at work right now, trying to figure this out...

Sorry, I forgot to paste inn all of the code, here are the lines for colTestModule (it's not null):

Dim objTestModule As New TestModuleController
Dim colTestModule As List(Of TestModuleInfo)
colTestModule = objTestModules.GetTestModules(ModuleId)

I did not understand what you ment by "Partial keyword in the Class definition on the CodeFile"? Could you please explain this a bit?

Thanks

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Problems in creating a moduleProblems in creating a module


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