Hi,
Being a newbie, I have been following Michael Washigton's "Super Simple" custom module development tutorial, working with my DNN installation in VS 2005. I have installed custom modules before with no problem. I have followed the instructions for the tutorial accurately. As per the tutorial I have created a folder in the DesktopModules folder. Within that folder, I created an custom control, with the HTML in the source view and the scripting in the code-behing file. The project compiles with no errors. I then register the "Super Simple" module with DNN.
When I try to install an instance of this "Super Simple" module in a page, I get an error
"DonNetNuke.Services.Exceptions.ModuleLoadException: Unable to cast object of type 'ASP.desktopmodules_supersimple_supersimple_ascx'
to type 'DotNetNuke.Entities.Modules.PortalMOduleBase'. at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings Portal Settings
The Code for the UI is
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="SuperSimple.ascx.vb"
Inherits="DesktopModules_SuperSimple_SuperSimple" %>
Search:
<asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>
<asp:Button ID="btnSearch" runat="server" Text="Button" /><br />
<br />
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
and the code-behing file is:
Imports DotNetNuke
Imports System.Web.UI
Imports System.Collections.Generic
Imports System.Reflection
Imports DotNetNuke.Security.PortalSecurity
Partial Class DesktopModules_SuperSimple_SuperSimple
Inherits Entities.Modules.PortalModuleBase
Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
ShowData("")
End If
End Sub
Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSearch.Click
ShowData(txtSearch.Text)
End Sub
Private Sub ShowData(ByVal SearchString As String)
Dim mySqlString As New StringBuilder()
mySqlString.Append("SELECT FriendlyName, Description ")
mySqlString.Append("FROM {databaseOwner}{objectQualifier}DesktopModules ")
mySqlString.Append("WHERE Description like '%' + @SearchString + '%' ")
mySqlString.Append("ORDER BY FriendlyName")
Dim myParam As SqlParameter = New SqlParameter("@SearchString", SqlDbType.VarChar, 150)
myParam.Value = SearchString
Me.GridView1.DataSource = CType(DataProvider.Instance().ExecuteSQL(mySqlString.ToString(), myParam), IDataReader)
Me.GridView1.DataBind()
End Sub
End Class
I would be most appreciative if someone could help me resolve why I'm getting this error. Forgive me if it's simple I'm a newbie. Thanks ahead
Rodriguez