Kelly Edvalson wrote:
The "inherits" tag in your ascx file needs to be the name of the class in your codebehind. It would look something like this
<%@ Control Language="VB" ClassName="Test" CodeBehind="View.ascx.vb" Inherits="MyProjectNamespace.DesktopModules_Test_View" AutoEventWireup="true" %>
Hi Kelly
Sorry to be a pain and come back again. Please excuse me, I haven't used VB in 15 years (I've been living in Delphiland) and someone changed it while I was away! :)
I've done all that, sort of. I *thought* my namespace was going to be 'DotNetNuke', but it doesn't like that or anything else I put. I'm getting 'Error 118 Could not load type DotNetNuke.'DesktopModules_Test_View', or whatever I put as namespace. If there's one defined in some project setting somewhere, I can't find it. I've looked through web.config and have these listed:
<add namespace="System.ComponentModel"> <add namespace="System.Data"> <add namespace="System.Data.SqlClient">
<add namespace="System.Drawing"> <add namespace="Microsoft.VisualBasic"> <add namespace="System.Globalization">
<add namespace="DotNetNuke.Services.Localization"> <add namespace="DotNetNuke.Entities.Users">
<add namespace="DotNetNuke"> <add namespace="DotNetNuke.Common"> <add namespace="DotNetNuke.Data">
<add namespace="DotNetNuke.Framework"> <add namespace="DotNetNuke.Modules">
<add namespace="DotNetNuke.Security"> <add namespace="DotNetNuke.Services">
<add namespace="DotNetNuke.UI"> <add namespace="DotNetNuke.Entities.Portals">
<add namespace="DotNetNuke.Common.Utilities">
<add namespace="DotNetNuke.Services.Exceptions">
<add namespace="DotNetNuke.Entities.Tabs">
Am I missing a line, or something, - besides a clue or two, that is?
Make sure that your code behind file is actually named "View.ascx.vb" also.
Yes, it's that.
One more thing, your partial class is the one that needs to inherit the portalbase. So instead of this:
"Partial Class DesktopModules_Test_View Inherits System.Web.UI.UserControl"
you need this "Partial Class DesktopModules_Test_View Inherits DotNetNuke.Entities.Modules.PortalModuleBase"
Thanks, I'll file this post away for the next time, if there is one. I'm doing a favour for a friend by trying to put this thing together, though I could get to like it if the learning curve wasn't quite so vertical. :)
Many thanks for your help, I really appreciate it.
Cheers
Ian