I have a website that has three different master pages, one for home, one for most content, and one for double wide (no right column) content. To help make it easier, I have created Web Parts for static HTML like the footer so that it can be used on each master page layout and only be changed in one place. When I did this everything was great. Then I noticed that there was a Layout tab on the Footer's web part properties. So I tried to monkey with it and create a secondary layout that was just a smaller version of the ASCX I created for my footer. Problem is that if I used the secondary layout, it throws errors. This is simple HTML that looks like this:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Footer.ascx.cs" Inherits="Footer" %>
<div class="nav nav1">
<a href="/">Home</a>
|
<a href="/About/Default.aspx">About Us</a>
|
<a href="/About/Default.aspx?id=1016">Services</a>
|
<a href="/ContentLibrary/Listing.aspx?Resource=Articles">Articles</a>
|
<a href="/ContentLibrary/Listing.aspx?Resource=Case Studies">Case Studies</a>
|
<a href="/ContentLibrary/Listing.aspx?Resource=All">Content Library</a>
|
<a href="/MediaRoom/Default.aspx">Media Room</a>
|
<a href="/mediaroom/newsletterlisting.aspx?id=374">Newsletters & Alerts</a>
|
<a href="/RSS/Default.aspx">RSS Feed</a>
|
<a href="/Sitemap.aspx">Site Map</a>
|
<a href="/About/Default.aspx?id=824">Privacy Policy</a>
|
<a href="/About/Default.aspx?id=826">Terms of Use</a>
|
<a href="/About/ContactUs.aspx?id=60">Contact Us</a>
</div>
<div class="nav nav2">
<a href="/Careers/Default.aspx">Leadership</a>
|
<a href="/leadership-nonprofit-board-members.aspx">Board Members</a>
|
<a href="/leadership-nonprofit-coo.aspx">Chief Operating Officers</a>
|
<a href="/leadership-nonprofit-cfo.aspx">Chief Financial Officers</a>
|
<a href="/move-to-a-nonprofit-career.aspx">Move to a Nonprofit Career</a>
|
<a href="/careers-at-bridgespan.aspx">Current Jobs at Bridgespan</a>
|
<a href="/careers-at-bridgespan.aspx">Current Job Openings</a>
</div>
<div class="nav nav3">
<a href="/LearningCenter/Default.aspx?id=392&taxid=236">Build Our Organization</a>
|
<a href="/LearningCenter/Default.aspx?id=384&taxid=106">Develop a Strategy</a>
|
<a href="/LearningCenter/Default.aspx?id=388&taxid=232">Fund Our Mission</a>
|
<a href="/LearningCenter/Default.aspx?id=386&taxid=128">Manage Performance</a>
|
<a href="/LearningCenter/Default.aspx?id=394&taxid=238">Recruit Leaders</a>
|
<a href="/FieldsOfInterest/Default.aspx?id=998&taxid=152&parentID=152">Education</a>
|
<a href="/FieldsOfInterest/Default.aspx?id=990&taxid=154&parentID=154">Environment</a>
|
<a href="/LearningCenter/Default.aspx?id=390&taxid=234">Philanthropy</a>
|
<a href="/FieldsOfInterest/Default.aspx?id=992&taxid=156&parentID=156">Youth</a>
|
<a href="/FieldsOfInterest/Default.aspx?id=994&taxid=158&parentID=158">Other Fields</a>
</div>
I created a secondary layout that looked like this:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Footer.ascx.cs" Inherits="Footer" %>
<div class="nav nav1">
<a href="/">Home</a>
|
<a href="/About/Default.aspx">About Us</a>
|
<a href="/About/Default.aspx?id=1016">Services</a>
|
<a href="/ContentLibrary/Listing.aspx?Resource=Articles">Articles</a>
|
<a href="/ContentLibrary/Listing.aspx?Resource=Case Studies">Case Studies</a>
|
<a href="/ContentLibrary/Listing.aspx?Resource=All">Content Library</a>
|
<a href="/MediaRoom/Default.aspx">Media Room</a>
|
<a href="/mediaroom/newsletterlisting.aspx?id=374">Newsletters & Alerts</a>
|
<a href="/RSS/Default.aspx">RSS Feed</a>
|
<a href="/Sitemap.aspx">Site Map</a>
|
<a href="/About/Default.aspx?id=824">Privacy Policy</a>
|
<a href="/About/Default.aspx?id=826">Terms of Use</a>
|
<a href="/About/ContactUs.aspx?id=60">Contact Us</a>
</div>
What am I doing wrong? Can I use a layout for a web part this way or is it really for web parts that have server controls?