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?