What I did to test it is I just copied and renamed the files terms.ascx and terms.ascx.vb under admin/skins to Header.ascx and Header.ascx.cs. Next I converted the vb file to C# using this web site:
http://www.carlosag.net/Tools/CodeTranslator/Default.aspx
The interesting thing is that the skin loads fine but the codebehind is not loading. I tried debugging in VS.2005 and it doesnt' work. However the debug works for the original version in vb.
On your post when you say that you have to inherit usercontrol you mean UI.Skins.SkinObjectBase right? If this code works the way it is in vb why wouldn't work after conversion? I think that there is something that is missing in the conversion.
Here is the code to test:
<%@ Control language="C#" AutoEventWireup="false" Explicit="True" Inherits="DotNetNuke.UI.Skins.Controls.Header" CodeFile="Header.ascx.cs" %>
namespace DotNetNuke.UI.Skins.Controls {
class Header : UI.Skins.SkinObjectBase {
// private members
private string _text;
private string _cssClass;
const string MyFileName = "Header.ascx";
public string Text {
get {
return _text;
}
set {
_text = value;
}
}
public string CssClass {
get {
return _cssClass;
}
set {
_cssClass = value;
}
}
[System.Diagnostics.DebuggerStepThrough()]
private void InitializeComponent() {
}
private void Page_Init(object sender, System.EventArgs e) {
// CODEGEN: This method call is required by the Web Form Designer
// Do not modify it using the code editor.
InitializeComponent();
}
// *******************************************************
//
// The Page_Load server event handler on this page is used
// to populate the role information for the page
//
// *******************************************************
private void Page_Load(object sender, System.EventArgs e) {
try {
// public attributes
if ((CssClass != "")) {
hypHeader.CssClass = CssClass;
}
if ((Text != "")) {
hypHeader.Text = Text;
}
else {
hypHeader.Text = Services.Localization.Localization.GetString("Header", Services.Localization.Localization.GetResourceFile(this, MyFileName));
}
hypHeader.NavigateUrl = NavigateURL("Header");
}
catch (Exception exc) {
// Module failed to load
ProcessModuleLoadException(this, exc);
}
}
}
}
Thanks
Rod