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/25/2007 9:20 AM
 

Hmmm really ...
 - I find it hard to believe that none of the books on ASP.NET 2.0 explain the standard method for how to handle a button click event - or any other event in ASP.NET for that matter.

But hey regardless >>>

1. your module has a mymodule.aspx file that declares the layout of the module - something like ...<asp:TextBox ID="txtSomeData" runat="server" Width="500px"></asp:TextBox>
<asp:Button ID="cmdSaveChanges" runat="server" Text="Save Data" />

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="MyModule.ascx.vb" Inherits="MyMod.Modules.MyModules.MyModule" %>

2.  The first line  declares a code behind file 'CodeFile' - which is stored in the same folder as the aspx file: 
This is where you put your CODE:   mymodule.aspx.vb

It will look something like the following

Some imports and stuff here:

Namespace

Partial Class MyModule
   Inherits
DotNetNuke.Entities.Modules.PortalModuleBase

Protected Sub cmdSaveChanges_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSaveChanges.Click

' The Handles statement at the end of the Subroutine declaration attaches this function to the CLICK action of the cmdSaveChanges button' Your code to save the data goes here

' Something like the following assuming you have set up DAL or DAL+

Dim myCTL as NEW MyModule.MyModuleController
Dim myINFO as NEW MyModule.MyModuleInfo

myINFO.SomeText = txtSomeData.Text

myCTL.add( myINFO)

End Sub
End Class
End Namespace

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

Now you should note that - BOTH these file are stored in the \DesktopModules\MyModule folder

The code is NOT stored in the App_Code directory ...

The only sort of code that should be put in the App_Code directory are generic class definitions such as the Controller and Info classes for your Data Access layer.

For example: in the file above the two classes instantiated here - would be defined in .vb class files in the App_Code directore

Dim myCTL as NEW MyModule.MyModuleController
Dim myINFO as NEW MyModule.MyModuleInfo

>>>>>>

Hope this helps to make things clearer for you

Westa

MyMod.Modules.MyModules
 
New Post
3/25/2007 7:09 PM
 
and
 
New Post
3/25/2007 7:57 PM
 

wtatters

Thanks its the dim for the controller that seems to be missing in the books and other information I have, they all mention the info file but not the controller.

such as page 260 in Nick Symmonds book Beginning DNN 4.0 Web Creation and the book Proffessional DNN 4 says a lot about nothing. 

Im adding it in I hope it works.

 

 

 
New Post
3/25/2007 8:35 PM
 
chaloum wrote

Thanks its the dim for the controller that seems to be missing in the books and other information I have 

Hey, did you read my Book? (grin)

Seriously though, the Core DNN4 book (I was also a tehnical reviewer on it so I'm bias for that one too) does cover the material. I use it as a reference for a lot of my tutorials. Speaking of tutorials have you seen any of them?

  • Super-Simple Module (DAL+)
  • Super-Fast Super-Easy Module (DAL+)
  • Using the DotNetNuke Website Starter Kit
  • Survey Module Tutorial (C# and VB)

    Also we have the DotNetNuke® 4 Module Development Guide (Download .PDF)

    We have so much information out there.



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

    Glad to be of some help

    You might also want to take a look at the source code of some of the DNN modules.

    They show a lot of the technology concepts in action

    Westa

     
    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