Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Need A Guidance with Module Development
Previous Previous
 
Next Next
New Post 5/5/2008 11:30 PM
User is offline Ignas
25 posts
10th Ranked


Need A Guidance with Module Development 

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 7:38 AM
User is offline Ian Robinson
529 posts
www.engagesoftware.com
8th Ranked


Re: Need A Guidance with Module Developmenty 

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


Ian Robinson
Engage Software
St. Louis, MO
314.966.4000



The leading provider of DotNetNuke support, training and custom development.
 
New Post 5/6/2008 12:08 PM
User is offline Ignas
25 posts
10th Ranked


Re: Need A Guidance with Module Developmenty 

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 3:08 PM
User is offline Rhys
51 posts
10th Ranked


Re: Need A Guidance with Module Developmenty 

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/6/2008 11:50 PM
User is offline Ignas
25 posts
10th Ranked


Re: Need A Guidance with Module Developmenty 

Hello Ian, Rhys,

the reason was AutoEventWireup="false"..

Thank you very much.

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Need A Guidance with Module Development
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


The Standard in Senior Housing Information
SNAPforSeniors provides consumers with free online resources to assist them with their search for senior housing
www.snapforseniors.com
DotNetNuke Web Hosting w/ ASP.NET 3.5
Unlimited email boxes, Unlimited databases, Unlimited domains. Plans start at $4.97
www.MyWinHosting.com
SteadyRain
Founded in 1999, SteadyRain has extensive experience delivering Internet technology strategies and solutions for a diverse client base, ranging from Fortune 500 firms to successful start-ups.
www.steadyrain.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP