Okay, rather than renaming the AbleCommerceAdmin theme and potentially tearing the fabric of the universe apart, I decided to create a HTTP Module that removes all the content from the HEAD of the login page... thus removing all references to AbleCommerceAdmin.
Here is the module, called LoginRequest.cs in the App_Code folder:
Code: Select all
using System;
using System.Web;
using CommerceBuilder.Products;
using CommerceBuilder.Catalog;
using System.Collections.Specialized;
using System.Collections.Generic;
using System.Web.UI;
public class LoginRequest : IHttpModule
{
private HttpApplication _app;
void IHttpModule.Dispose()
{
// Nothing to dispose;
}
public void Init(HttpApplication application)
{
_app = application;
application.PostMapRequestHandler += (new EventHandler(OnPostMapRequestHandler));
}
private void OnPostMapRequestHandler(Object source, EventArgs e)
{
IHttpHandler pageHandler = null;
if (_app.Context.Handler is System.Web.UI.Page)
{
pageHandler = _app.Context.Handler;
}
if (pageHandler != null)
{
AddEventsToPage((Page)pageHandler);
}
}
private void AddEventsToPage(Page pageHandler)
{
pageHandler.LoadComplete += new EventHandler(LoadComplete);
}
private void LoadComplete(Object sender, EventArgs e)
{
if (_app.Request.RawUrl.Contains("Login.aspx"))
{
((Page)sender).Header.Controls.Clear();
((Page)sender).Header.InnerHtml = "";
}
}
}
Then, I added a reference to it in the HTTP Modules section of the Web.Config:
Code: Select all
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="AbleCommerceHttpModule" type="CommerceBuilder.Services.AbleCommerceHttpModule, CommerceBuilder.Services" preCondition="managedHandler"/>
<add name="LoginRequest" type="LoginRequest"/>
</modules>
I then created a master page for the Login.
Here is the meat of the Login.master:
Code: Select all
<body onLoad="initAjaxProgress();">
<form id="form1" runat="server">
<ajax:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" AsyncPostBackTimeOut="600" />
<ajax:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="1000">
<ProgressTemplate>
<div id="ajaxProgressBg"></div>
<div id="ajaxProgress"></div>
</ProgressTemplate>
</ajax:UpdateProgress>
<asp:contentplaceholder ID="MainContent" runat="server">
</asp:contentplaceholder>
</form>
</body>
Then, in the Login.aspx page, I changed the first line to reference this master page:
Code: Select all
<%@ Page Language="C#" MasterPageFile="~/Admin/Login.master" CodeFile="Login.aspx.cs" Inherits="Admin_Login" Title="Login" %>
The result? The admin login page looks very plain... no reference to AbleCommerce