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 2:16 AM
 

 

AdefWebserver

Read that plus the links they don’t make sense either.  It's not point in telling the reader to delete everything in the files that are created by the dnn module template in VWD 2005 with code.   It’s confusing and doesn’t help.

After gazing at the five different way to achieve the same thing did notice in the cut and paste code the use of the form view but that also lead me down a path to nowhere.

I thought I asked a simple question only to find that there doesn’t seem to be an answer.

How do you trigger the add function event in the controller (I assume it’s in the controller.vb that’s unclear as well) from a button click.  What is the trigger? All I get is confusing mumbo jumbo.

 

doesn’t anyone know the syntax?????  Aslo why would I go to all this trouble to use the DNN functions instead of using straight forward .Net2 functions?  The formview came the closest to being sensible but its not clear how the event is triggered.

can anyone answer the question clearly and concisely

 
New Post
3/26/2007 2:18 AM
 

Westa

nope didnt work still dont know how to trigger the event.

 

 
New Post
3/26/2007 5:04 AM
 
They're trying their best to help you, guy, and everything they have told you is correct. You need to back up a few steps.

1. Can you create a regular, everyday, competely normal UserControl that uses code-behind in a regular, normal, everyday ASP.Net application? If, when you created the control, you selected the appropriate checkbox ("place code is a separate file"), the code-behind is created for you in the same folder as the control's ascx  file.

The App_Code folder generally does not contain code-behind files for controls or pages. It is for components and classes that have no user interface, such as business objects. You're fixated on this folder for some reason. Let it go. Your event handlers belong in your controls' code-behind files and Visual Studio will create them in the same folder as the ascx file. (You can move them, but you need to then edit the path in the Control directive.)

2. Can you drag a button onto the design surface of your newly created UserControl, double-click it in the designer, and see that the code generator created the event handling code in for you in the code-behind file?

3. The only difference between the control you just made and a DNN module is that the DNN module inherits from PortalModuleBase instead of Usercontrol, and otherwise, it is exactly the same process.  You handle events normally and there's nothing special about a module other than the properties and methods provided by the base class.

I'm not sure what you mean by "know the syntax". It's just an event handler for a button, just like normal ASP.Net.

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
    ' Your code here...
    End Sub
 
New Post
3/26/2007 5:22 AM
 
chaloum wrote

How do you trigger the add function event in the controller (I assume it’s in the controller.vb that’s unclear as well) from a button click.  What is the trigger? All I get is confusing mumbo jumbo.

 



Are you asking how to call a method in your controller? When you use the module template in VS, a *sample* controller is created for you. It is intended that you edit it (which is why Michael removed the code in his tutorials). You put whatever methods you need to in this controller and call it like you would anything else: Namespace.Method(parameters)

The controller is your interface to your data, so you need to define that stuff. You can bind the controller to an ObjectDatasource instance if you want to.
 
New Post
3/26/2007 7:27 AM
 

You really seem to be making HARD going of a pretty straight forward concept - hmmm -

OK  -  step by step.

Create a folder in \DesktopModules\  called MyModule

Inside there create your module ascx file  TestIt.ascx

<%

@ Control Language="VB" AutoEventWireup="false" CodeFile="TestIt.ascx.vb" Inherits="DesktopModules_WL_System_TestIt" %>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><br />
<
asp:Button ID="Button1" runat="server" Text="Button" /><br />
<
asp:Label ID="Label1" runat="server"></asp:Label>

Also in the same folder add its code behind module:  TestIt.ascx.vb

Imports

And thats actually all that is needed to get a module working inside DNN

When you hit the BUTTON the sub routine is triggered and the code fires.

NOTE - this is standard ASP.NET code behind syntax - and nothing more - its nothing special.

Westa

DotNetNuke

Partial Class DesktopModules_WL_System_TestIt
  
Inherits Entities.Modules.PortalModuleBase

  Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
     'Your Code Goes here
     Label1.Text = TextBox1.Text & " Clicked"
  End Sub

End
Class
 
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