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.0post form in custom mudule developmentpost form in custom mudule development
Previous
 
Next
New Post
3/26/2007 10:40 PM
 

Paragraph 3 should read

in this context the use of classes in unfamiliar and the documentaion I have read rolls the class into one file. DNN on the other hand uses 4 files two of the files are clear to me but the info and controll files I dont get.

 
New Post
3/26/2007 11:45 PM
 

OK - this is making my brain hurt ... lets see.

( ASP.NET classes 101 )

The contents of files in the \App_Code\ directory are all based around standard asp.net CLASS definitions.

That is - they define a class that can be used - anywhere in the website.  You can put any class you want in a .vb in this area - and it will always be compiled and made available to the rest of your site.

A class definition is a block of code - that defines the structure and implementation of a object.  THey contain properties and methods

You access a class by creating an INSTANCE of the class in your module code

DIM myclassitem as new myclass

The INFO and CONTROLLER classes that seem to be confusing you so much are two DNN specific classes that help you handle access to the Database in an elegant way.

For the purposes of this thread - both michael and others are talking about DNN DAL+ which uses 2 class objects - the more complicated DNN DAL uses a couple of additional class constructs to allow for data access abstraction - but lets leave that to the side for now.

The INFO class is a normal ASP.NET class that defines the structure of the object that represents a MSSQL table that you are trying to access

The CONTROL class is a normal ASP.NET class that defines the methods used to physically access the database and hydrate or populate the info class.

Assuming you have created the info class and controll class - you access them as you would any other asp.net class.

' firest CREATE new class object

DIM myController as new MyControllerClass
DIM myInfo as new MyInfoClass

' you can now use the methods in the controller class to work with the info class

'add data

myInfo.idkey = 1
myInfo.sometext = "hello"
myController.update( myInfo)

'get data

myInfo = myController.getkey(1 )
myvalue = myInfo.sometext

'update data

myInfo = myController.getkey( 1 )
myInfo.sometext = "hello again"
myController.update( myInfo)

'delete data

myInfo = myController.getkey( 1 )
myController.delete( myInfo)

>>>>>>>>>>>>>>>

As to how you create the DAL+ classes - there are a number of ways
- by hand
  they are not really that hard to create
  look at the code in an existing sample for starters

- using a codesmith DAL+ template
   http://community.codesmithtools.com/forums/thread/21596.aspx
   or do a search of the threads here for codesmith

- using other 3rd party DAL+ class generators.
  check out www.snowcovered.com and other stores

>>>>>>>>>>>>>>>>

Westa

 
New Post
3/26/2007 11:57 PM
 

If you have read all the books and all the documentation and you still don't get it then this may be over your head.  Don't blame anybody else for it.  Many people have gotten this to work and when they post their questions they are a lot more respectful.  Something is wrong WITH YOU and WITH YOUR APPROACH to learning this.  Maybe your attitude gets in the way.  You also need a solid foundation in object oriented architecture.

I recommend you study the implementation of a module like the Survey module.  Open the View form and start going back to the definition of the data objects used in the UI.  And by the way, the use of the full DAL is not easy and you don't have to use it completely as it is.  That is why the DAL+ came to be, check it out.

Again, maybe if you tone down the language of your posts you will get more help, just a guess.

Carlos

 

 
New Post
3/27/2007 12:44 AM
 

carlosRafi

you sound like a teacher thats one that cant teach. its always the students fault that the teacher cant teach

 
New Post
3/27/2007 1:38 AM
 

Westa

thanks now we  are getting somewhere.   Still a few grey areas but thats cool, its working. 

Now the moduleID where does that come from? how do I access it? and where do I put it?

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0post form in custom mudule developmentpost form in custom mudule development


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