Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0vb.net works and C# failsvb.net works and C# fails
Previous
 
Next
New Post
9/8/2006 4:32 PM
 

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
}


    - Doug Vogel     

 
New Post
9/11/2006 2:07 PM
 
 No DNNer's handy at C# programming?  I did searches.  I couldn't find any bare bones example that works for me.

    - Doug Vogel     

 
New Post
9/11/2006 10:04 PM
 
They are far different if one has AutoEventWireup="true" and the other AutoEventWireup="false"
 
New Post
9/12/2006 3:57 PM
 

true or false - Still doesn't work either way.

I am just trying to find the simplest C# module written without DAL & compiled with command line compiler.

But I don't know anything about C# - I was hoping someone who does could give me a little help...  Can't even find any links that work (or are simple).


    - Doug Vogel     

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0vb.net works and C# failsvb.net works and C# fails


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out