PDA

View Full Version : More images in header problems


SwizzleSkids
10-25-2004, 07:24 PM
So like Rob Welsh in the previous thread I am trying to place an image in the header in place of the current text. I followed the instructions from the "panels without recompiling" KB article:
http://www.interspire.com/support/articlelive/index.php?ToDo=view&questId=10&catId=1

This worked for the work I was doing on the footer panel - but when I created a new header panel I keep getting this error message:

External component has thrown an exception.

I know it's probably just something that I didn't delete out of the new PageHeader panel. Using the Default-Stretched template - here is the new PageHeader2 panel:

<%@ Control Language="c#" AutoEventWireup="true" Inherits="Interspire.ArticleLive.Web.BaseUserControl" %>
<%@ Import namespace="Interspire.ArticleLive.Web" %>

<script language="C#" runat="server">

public abstract class PageHeader : BaseUserControl
{


private PageSet currentPages;

{
get { return currentPages; }
set { currentPages = value; }
}

private void Page_Load(object sender, System.EventArgs e)
{
this.EnableViewState = false;
if (!IsPostBack)
{
CurrentPages = (new PageEngine(Config.Current)).GetLivePages(false);
DataBind();
}
}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();

base.OnInit(e);
}

/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion
}

</script>

<TABLE id="Table1" cellSpacing="0" cellPadding="0" width="100%" border="0" class="PageHeader">
<TR>
<TD><table width="100%" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td class="Main"><a href='<%= Config.Current.HomePagePath %>'><%= Config.Current.WebSiteName %></a></td>
<td class="Menu">
<A href="<%= Config.Current.HomePagePath %>"><%= ResourceHelper.GetString("Home") %></A> | <asp:Repeater Runat=server DataSource='<%# CurrentPages %>' id=Repeater1><ItemTemplate><a href='<%# LinkHelper.CreatePageLink((Interspire.ArticleLive. Page)Container.DataItem) %>'><%# DataBinder.Eval(Container.DataItem, "Title") %></a>&nbsp;|&nbsp;</ItemTemplate></asp:Repeater> <A href="<%= Config.Current.SiteMapPagePath %>">
<%= ResourceHelper.GetString("SiteMap") %></A> | <A href="<%= Config.Current.SyndicatePagePath %>"><%= ResourceHelper.GetString("Syndicate") %></A>
</td>
</tr>
</table>
</TD>
</TR>
<TR>
<TD class="Bar"></TD>
</TR>
</TABLE>

Basically I took out the two lines that had "protected" at the front:
protected System.Web.UI.WebControls.Repeater Repeater1;
and
protected PageSet CurrentPages

Does anyone know what I'm doing wrong?

This leads me to another question - editing the panels this way (recompiling on the fly) I'm told will:

This approach will slightly lower the performance of your code but unless you have a very heavy load on your server it shouldn't make a significant difference.

What exactly does this mean? Will the website run slower? And how much is "a heavy load?"

John (Interspire Staff)
10-26-2004, 01:50 AM
Hi SwizzleSkids,

I've updated the KB entry to make something a little clearer. The problem is that when using this technique you can't include the actual class, which is this part:


public abstract class PageHeader : BaseUserControl
{
}


If you take that out then it should work.

I've done some more reading and apparently because of the way ASP.NET works there is no performance difference between either model for most requests. There is however a performance hit the first time the page or panel is loaded, because ASP.NET must dynamically compile the code, but after that it seems to be the same.

We've created a new UI model in ActiveKB 2005 that drastically reduces the amount of code required in each panel and removes the need for code-behind. It will most likely be implemented into ArticleLive in the future.

Let me know if you need any more help.

SwizzleSkids
10-28-2004, 10:44 PM
We've created a new UI model in ActiveKB 2005 that drastically reduces the amount of code required in each panel and removes the need for code-behind. It will most likely be implemented into ArticleLive in the future.

Let me know if you need any more help.

Thanks John - so here's what i need to know: I'm editing a lot of panels by the above method, changing things around in the code-behind and recompiling on the fly. When AL is upgraded - will I need to do this all again? Should I bother proceeding with customization?

John (Interspire Staff)
10-29-2004, 07:06 AM
Hi SwizzleSkids,

Do the customisations. Just keep a good merger application on your PC for when it comes time to upgrade. Check the changelogs to know which template files were modified.

SwizzleSkids
10-29-2004, 06:06 PM
Hi SwizzleSkids,

Do the customisations. Just keep a good merger application on your PC for when it comes time to upgrade. Check the changelogs to know which template files were modified.

Therein lies the problem, John - what is a merger application? I assume it would merge the updated asp files or something? Is there one available for free?

I've sort of been mixing and matching my changes - for example, I still couldn't get the header-code-behind method to work, so I gave up and just changed the actual panel (.ascx) Will this type of change be kept with the merger application?

John (Interspire Staff)
11-01-2004, 12:26 AM
Hi SwizzleSkids,

A file merge application shows you the differences between files and/or folders and allows you to merge the differences together. I'm not aware of any merge applications that are available for free but I use Beyond Compare which is awesome, and you can get a trial download from http://www.scootersoftware.com/. The merge application doesn't do it automatically, it shows you all the differences and you choose which ones to keep. I don't quite understand what you did with that file but the merge application should be able to handle it.