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.0Need A Guidance with Module DevelopmentNeed A Guidance with Module Development
Previous
 
Next
New Post
5/6/2008 2:30 AM
 

Hello everyone,

I have developed module using DNN Module Developers Guide documentation, but it seems not work properly. I need to ask few question and hope someone will assist me.

For example this is the modules MyModule.ascx file:


<%@ Control Language="C#" AutoEventWireup="false" CodeFile="MyModule.ascx.cs" Inherits="Modules.MyModule" %>
<table id="inputTable">
    <tr>
        <td><asp:TextBox ID="txtSearch" runat="server"></asp:TextBox></td>
        <td><asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="Go1" resourcekey="btnSearch" /><asp:ImageButton runat="server" ID="imgBtnSearch" resourcekey="imgBtnSearch"/></td>
    </tr>
</table>

The problem occures in MyModule.ascx.cs file in Page_Load or in Page_Init:

namespace Modules
{
    public partial class MyModule : DotNetNuke.Entities.Modules.PortalModuleBase,
        DotNetNuke.Entities.Modules.IActionable
    {
        private DataTable dataTable;

        protected void Page_Init(object sender, EventArgs e)
        {
            this.dataTable = new DataTable();
            this.txtSearch.TabIndex = 1;
            this.btnSearch.TabIndex = 2;
            this.imgBtnSearch.TabIndex = 3;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.txtSearch.Text = LocalResourceFile + " file";
        }
    }
}

I've add this.txtSearch.Text = LocalResourceFile + " file" to debug and when MyModule loads, nothing in txtSearch appear. So I am curious is there anything in the code looks buggy?

I'm stuck here because I need to program: if imgBtnSearch has imgBtnSearch.ImageUrl specified in LocalResourceFile, so imgBtnSearch has to be shown, otherwise btnSearch has to be shown.

From all this I have one conclusion that MyModule.ascx.cs do not understand what any web control on MyModule.ascx is. Although if I add some event handlers the event is handled, from the first look, ok..

I have developing module from the separate project in the same DotNetNuke salution and adding references to that project. So the project dll is added to the DotNetNuke website bin.

I also noticed that TabIndexes added in Page_Init is not correctly added.

From all this I suspect something bad is in the Page_Init and Page_Load event handlers (could it be??)..

If I develop module using WAP (C#), for all user control designer generates partial designer class, do I need to add that partial class in the DotNetNuke DesktopModules folder?

 
New Post
5/6/2008 10:38 AM
 

Hey Ignas,

Try using this.txtSearch.Text = Localization.GetString("file", LocalResourceFile); to return the localized value.

Also, you may not want to use the Page_Init method and just place your code in the page load method. Review this page for more clarification on the page lifecycle: ASP.NET Page Lifecycle

The partial classes you are seeing are expected when developing WAP modules - even in the desktopmodules folder. Don't worry about that. Look here for some more information on WAP / Partial Classes -- Web Application Projects

Take care,

Ian


Software Engineer
Co-Founder, dnnGallery
Stack Overflow: Ian Robinson
Twitter: @irobinson
Linked In: Ian Robinson
 
New Post
5/6/2008 3:08 PM
 

Hi, Ian,

I'm thankfull for your reply. I'will certainly folow your links, it is really usefull info.

About that this.txtSearch.Text = Localization.GetString("file", LocalResourceFile), well in fact deeper in the code I am using similar statement to provide Localized text for label control (I just thought it's not necessary for the example). So, it doesn't work..

You know, Ian, what is funny, when i firstly add MyModule to the DotNetNuke it worked cool, I mean everything was as planned, but that was only test version to see if I am logically right. After that I made some slight changes to the code and I get what I have now. All code in the Page_Init and Page_Load doesn't work. So i'm pretty stuck here.

Well, once more - thanks for the info.

Regards,
Ignas

 


 
New Post
5/6/2008 6:08 PM
 

Have you tried;

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MyModule.ascx.cs" Inherits="Modules.MyModule" %>

Rhys


www.rmjcs.com - Mostly SQL Server Stuff
 
New Post
5/7/2008 2:50 AM
 

Hello Ian, Rhys,

the reason was AutoEventWireup="false"..

Thank you very much.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Need A Guidance with Module DevelopmentNeed A Guidance with Module 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