I don't recall where I got this from but I would like to update it to run on the 4.03 Version of DNN. The comiled DLL i had worked on the 4.0.3 version but I was experiencing slow performance on that system. Thinking that it could be due to framework type mismatches (ie, the page title being compiled for .net 1.1) i decided to try and update it.
I've got the source setup and can compile the website in VS 2005 so then I decided to try and integrate the old vb scripts. That didn't work too well since it was written in VS 2003. I then decided to create a new C# usercontrol and then I updated the references to mirror the privacy.ascx modules.
Now everything compiles but I think i'm missing something. Perhaps someone more elightened with asp.net 2.0 and dnn 4.x can help me out here.
My initial guess is that I don't know what i'm doing when it comes to the new C# 2.0 model. These partial classes don't make sense to me yet however The control does compile and does load on my page. It just doesn't pull in the name of the page.
pagetitle.ascx.cs contents
using System;
using System.Web;
using DotNetNuke;
namespace DotNetNuke.UI.Skins.Controls
{
public partial class PageTitle : DotNetNuke.UI.Skins.SkinObjectBase
{
private string _cssClass;
const string MyFileName = "PageTitle.ascx";
public string CssClass
{
get { return _cssClass; }
set { _cssClass = value; }
}
#region " Web Form Designer Generated Code "
[System.Diagnostics.DebuggerStepThrough()]
private void InitializeComponent()
{}
private void Page_Init(object sender, EventArgs e)
{
InitializeComponent();
}
#endregion
/* */
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!(Page.IsPostBack))
{
if (CssClass != "")
{
lblPageTitle.CssClass = CssClass;
}
}
lblPageTitle.Text = PortalSettings.ActiveTab.TabName.ToString();
}
catch (Exception exc)
{
DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(this, exc);
}
}
}
}
PageTitle.ascx contents
<%@ Control Language="C#" AutoEventWireup="false" CodeFile="pagetitle.ascx.cs" Inherits="DotNetNuke.UI.Skins.Controls.PageTitle" %>
<asp:Label id="lblPageTitle" runat="server" CssClass="PageTitle"></asp:Label>