You need to Register for free and Login to post a message in the forum.

Forum

Subject: Help with simple User Control
Prev Next
You are not authorized to post a reply.

Author Messages
altein
Nuke Active Member
Nuke Active Member
Posts:26

10 Dec 2007 8:03 AM  

I am trying to make a barebones user control for a module in DotNetNuke.  I apologize if this isn't the right forum.   The module compiles and can be added to the list of available modules in the Control Panel:  But in the container, I receive the following error.  The name of the control is Login2.  It simply outputs the information entered by the user in a login box.

This is the error I receive

Error: Login2 is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: Unable to cast object of type 'ASP.admin_skins_login_ascx' to type 'DotNetNuke.Entities.Modules.PortalModuleBase'. ---> System.InvalidCastException: Unable to cast object of type 'ASP.admin_skins_login_ascx' to type 'DotNetNuke.Entities.Modules.PortalModuleBase'. at DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo objModule, PortalSettings PortalSettings) --- End of inner exception stack trace ---

Here is the code for the user control named Login2.ascx

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Login2.ascx.vb" Inherits="AlteinEnterprises.CoffeeShopListing.Login2" %>

<table style="border-style:solid; border-color: Black;">
<
tr>
  <td><b>Loginb>td>
  <td><asp:TextBox ID="User" runat="server" />td>
tr>
<
tr>
  
<td><b>Passwordb>td>
  
<td><asp:TextBox ID="Pass" runat="server" />td>
tr>
<
tr>
 
<td>td>
 
<td><b>Passwordb>td>
 
<td><asp:Button id="buttton" Text="Submit" runat="server" />td>
tr>
table>
<
p><asp:Label ID="lblMessage" runat="server" />p>

This is the code-behind for the user control

Imports DotNetNuke
Namespace AlteinEnterprises.CoffeeShopListinga
Partial Class Login2
    
Inherits Entities.Modules.PortalModuleBase

Public UserName As String

Public Password As String

Public Sub Submit(ByVal Sender As Object, ByVal e As EventArgs)

lblMessage.Text = "UserName: " & User.Text & _

"
"
& "Password: " & Pass.Text & ""

End Sub
End Class
End
Namespace

I do not know why I am receiving this error and I would be so very appreciative if some one could help me out.

Thanks,
altein

jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2318


10 Dec 2007 8:16 AM  
>Namespace AlteinEnterprises.CoffeeShopListinga

If that's not a transcription error, remove the "a" at the end of the line.

Joe Craig
DNN Creative Support
Subscribe to the website
altein
Nuke Active Member
Nuke Active Member
Posts:26

10 Dec 2007 8:31 AM  
Hi,

Namespace AlteinEnterprises.CoffeeShopListinga

the 'a' is just a typo. In my code, it doesn't exist. It is only AlteinEnterprises.CoffeeShopListing

Thanks,
altein
jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2318


10 Dec 2007 8:48 AM  
Looking more ... the error messages seem to refer to the skin. Are you including this module in your skin?

One way to go about debugging this would be to install a version of DNN on a local computer, add this module and skin, and then run the web site under Visual Web Developer or Visual Studio. If you do that you can check for compile errors, set breakpoints, etc. That would probably help you locate the source of the problem more easily.

Joe Craig
DNN Creative Support
Subscribe to the website
jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2318


10 Dec 2007 9:10 AM  
Oh, just another thought. If you are trying to mimic the DotNetNuke login module, you might want to take a look at it's source. In particular, the code-behind for that "Inherits UserModuleBase" which is different than your code.

Joe Craig
DNN Creative Support
Subscribe to the website
altein
Nuke Active Member
Nuke Active Member
Posts:26

10 Dec 2007 9:22 AM  
Dear Mr. Craig,

Thank you so much for your advice and information.  It turns out I just had the "login" user control, login.ascx, set as the control for the "login2" (the module I created) module in the module definitions.  I just changed the user control for the module "login2" to the login2.ascx.

My apologies,
Thanks again
jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2318


10 Dec 2007 9:24 AM  
Super!

Joe Craig
DNN Creative Support
Subscribe to the website
You are not authorized to post a reply.
Forums > Users Lounge > Everything Else > Help with simple User Control



ActiveForums 3.7

Latest Forum Posts

RE: EasyCGI help? by Dr Joe
I'll let you know how it works out. I think I opened up about 6 tickets with them so far. ...
RE: EasyCGI help? by derpir
Hi Joe amazing to say the least! I will change host to PowerDNN as soon as possible, seems to me t...
RE: EasyCGI help? by Dr Joe
Amazing - I'm going through this exact same thing with EasyCGI! I managed to successfully instal...
Running the local host installation after building the application by saintX
My localhost installation of DNN was running blameless. After I oppened the application with VWD it ...
RE: quick question by derpir
Hello Is it possible to buy two skins and combine them? for example put one skins visual attributes...
RE: Environment Variables by leesykes
Thanks for the info,
RE: How can i edit any module from front end by sanju_k1421
ok if i added an text html . now i want to fill into that have to log in ,but i want that an...
Module not working when logged off. by t.ramya85
Hi friends,I have created two modules which interact with each other and i have kept one module to b...
RE: Environment Variables by fandnet
There are many ways to use variables like what I was trying to use...But here is how I did it.DotNet...
RE: OpenForce '08 by mgordon
It was truly a great time.  I really feel this year was much better than last year.  I hope to ge th...
Environment Variables by fandnet
I am creating a simple module that registered users can use to send an email invitation to people wh...
RE: How can i edit any module from front end by leesykes
I'm not sure that I follow, could you provide an example?
RE: Development of modules by leesykes
Hello,Glad you find them useful, at the moment there are not any plans to go into Module Development...
RE: SQL Server 2008 Documents Module DotNetNuke by leesykes
Hello,Thanks for the tip. Yes both connection strings are in correctly and the user has full permiss...
RE: Now, portal creation problem by jncraig
Since you have other issues with installing modules, etc. I believe that you are correct that it's a...
RE: How do I display the current time by jncraig
The [CURRENTDATE] skin object has a DateFormat attribute. The examples give MMMM dd, yyyy as a typi...
RE: Now, portal creation problem by SupaHoopsa
Posted By jncraig on 18 Nov 2008 8:54 AMIf there are other errors related to the database, I would s...
RE: SQL Server 2008 Documents Module DotNetNuke by MobileNow
Make sure that both of the connection strings are the same in the web.config file. Also make sure t...
RE: Now, portal creation problem by jncraig
If there are other errors related to the database, I would start by looking there.  This could be so...
Un-installing SQL Server 2005 by leesykes
I'm in the process of un-installing SQL Server 2005 and while doing this it informs me that Full Tex...
DotNetNuke Modules
RSS Feeds