Both .vb and .cs compiles Okay. The .vb module works in the portal.
C# gives error = MinMax persistance type of cookie requires a ModuleId. I'm not familiar at all with C#, so what could one add to the C# code to fix this?
ASCX File for vb.Net is
<%@ Control Language="vb" AutoEventWireup="false" Inherits="Hello_World_013.Hello_World_013" CodeBehind="Hello_World_013.vb" %>
<!-- Friday, September 08, 2006 -->
<asp:Label id=EZ_Label runat="server" CssClass="phd_SMC_Hello_World_013"></asp:Label>
ASCX File for C# is about the same thing:
<%@ Control language="C#" AutoEventWireup="true" Inherits="CSharp_014.CSharp_014" CodeFile="CSharp_014.cs"%>
<!-- CSharp_014 was created September 08, 2006 -->
<asp:Label id=EZ_Label runat="server" CssClass="phd_SMC_CSharp_014"></asp:Label>
The .vb code File for vb.Net is
Imports System
Imports System.Web
Imports System.IO
Imports System.Diagnostics
Imports System.Text
Imports DotNetNuke
Imports DotNetNuke.Common
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Data
Imports DotNetNuke.Entities.Users
Imports DotNetNuke.Framework
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization
Imports DotNetNuke.Services.Search
Imports DotNetNuke.UI
Imports Microsoft.VisualBasic
Namespace Hello_World_013
Public MustInherit Class Hello_World_013
Inherits DotNetNuke.Entities.Modules.PortalModuleBase
Protected WithEvents EZ_Label As System.Web.UI.WebControls.Label
Private _cssClass As String
Public Property CssClass() As String
Get
Return _cssClass
End Get
Set(ByVal Value As String)
_cssClass = Value
End Set
End Property
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
If Not Page.IsPostBack Then
If CssClass <> "" Then
EZ_Label.CssClass = CssClass
End If
EZ_Label.Visible = True
EZ_Label.text = "Hello World"
End If
Catch exc As DotNetNuke.Services.Exceptions.BasePortalException
Dim objXLogCtl As New DotNetNuke.Services.Log.EventLog.ExceptionLogController
objXLogCtl.AddLog(exc)
End Try
End Sub
End Class
End Namespace
The .cs code File for C# is
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using System.Web.UI;
using System.Web.UI.WebControls;
using DotNetNuke;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Entities.Modules.Actions;
using DotNetNuke.Security;
using DotNetNuke.Services.Exceptions;
using DotNetNuke.Services.Localization;
namespace CSharp_014
{
/// Disable assignment warning
#pragma warning disable 649
partial class CSharp_014 : PortalModuleBase
{
protected System.Web.UI.WebControls.Label EZ_Label;
/// Page_Load
protected void Page_Load(System.Object sender, System.EventArgs e)
{
try
{
EZ_Label.Text = "Hello World";
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}
}
#pragma warning restore 649
}