Nonprogrammer trying to convert theme needs help!

Topics: ASP.NET 2.0, Controls, Themes
Aug 31, 2010 at 8:10 PM

Thank you for your time and your help.

Here is the site.master

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="site.master.cs" Inherits="Flower2site" %>
<%@ Register Src="~/admin/menu.ascx" TagName="menu" TagPrefix="uc1" %>
<%@ Import Namespace="BlogEngine.Core" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">


<head runat="server">
    <link rel="stylesheet" href="styles/style.css" type="text/css" />
    <link rel="shortcut icon" href="~/pics/blogengine.ico" type="image/x-icon"/>
</head>


<body>
  <asp:ContentPlaceHolder ID="cphBody" runat="server" />
              
    <form id="form1" runat="server">
   
    <div id="main">
    <div id="links"></div>
    <div id="header">
      <div id="logo">
        <div id="logo_text">
          <!-- class="green", allows you to change the colour of the text - other classes are: "blue", "orange", "red", "purple" and "yellow" -->

          <h1><%=BlogSettings.Instance.Name %></h1>
          <h2><%=BlogSettings.Instance.Description %></h2>

        </div>
      </div>
      <div id="menubar">
        <ul id="menu">
          <!-- put class="tab_selected" in the li tag for the selected page - to highlight which page you're on -->
          <li class="tab_selected"><a href="index.html">Home</a></li>
          <li><a href="our_services.html">Our Services</a></li>
          <li><a href="about_us.html">About Us</a></li>
          <li><a href="styles.html">Styles</a></li>
          <li><a href="contact.html">Contact Us</a></li>
        </ul>
      </div>
    </div>
    <div id="site_content">
      <div class="sidebar">
        <!-- insert your sidebar items here -->
        <h1>Latest News</h1>
        <h2>New Website Launched</h2>
        <h3>January 1st, 2010</h3>
        <p>2010 sees the redesign of our website. Take a look around and let us know what you think.<br /><a href="#">Read more</a></p>
        <h1>Useful Links</h1>
        <ul>
          <li><a href="#">link 1</a></li>
          <li><a href="#">link 2</a></li>
          <li><a href="#">link 3</a></li>
          <li><a href="#">link 4</a></li>
        </ul>
        <h1>Useful Info</h1>
        <p>You can put anything you like in the sidebar. Latest news, useful links, images, contact information. Anything you think the visitor will find useful.</p>
      </div>
      <div id="content">
        <!-- insert the page content here -->
        <h1>Welcome to the flowers_2 template</h1>
        <p>This standards compliant, simple, fixed width website template is released as an 'open source' design (under the <a href="http://creativecommons.org/licenses/by/3.0">Creative Commons Attribution 3.0 Licence</a>), which means that you are free to download and use it for anything you want (including modifying and amending it). All I ask is that you leave the 'design by dcarter' link in the footer of the template, but other than that...</p>
        <p>This template is written entirely in XHTML 1.1 and CSS, and can be validated using the links in the footer.</p>
        <p>You can view my other 'open source' template designs <a href="http://www.dcarter.co.uk/templates.html">here</a>.</p>
        <p>This template is a fully functional 5 page website, with a <a href="styles.html">styles</a> page that gives examples of all the styles available with this design.</p>
        <h1>Browser Compatibility</h1>
        <p>This template has been tested in the following browsers:</p>
        <ul>
          <li>Internet Explorer 8</li>
          <li>Internet Explorer 7</li>
          <li>FireFox 3</li>
          <li>Google Chrome 2</li>
          <li>Safari 4</li>
        </ul>
      </div>
    </div>
    <div id="footer">Copyright &copy; Company Name. All Rights Reserved. | <a href="http://validator.w3.org/check?uri=referer">XHTML</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> | <a href="http://www.dcarter.co.uk">design by dcarter</a></div>
  </div>

  


    </form>
</body>
</html>
Here is the results error:

Ooops! An unexpected error has occurred.

This one's down to me! Please accept my apologies for this - I'll see to it that the developer responsible for this happening is given 20 lashes (but only after he or she has fixed this problem).

Error Details:

Url : http://localhost:27521/Flower2/default.aspx

Raw Url : /Flower2/default.aspx

Message : Exception of type 'System.Web.HttpUnhandledException' was thrown.

Source : System.Web

StackTrace : at System.Web.UI.Page.HandleError(Exception e)

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

at System.Web.UI.Page.ProcessRequest()

at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)

at System.Web.UI.Page.ProcessRequest(HttpContext context)

at ASP.default_aspx.ProcessRequest(HttpContext context)

at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

TargetSite : Boolean HandleError(System.Exception)

Message : Unable to cast object of type 'ASP.PostView' to type 'BlogEngine.Core.Web.Controls.PostViewBase'.

Source : App_Web_hf100msi

StackTrace : at User_controls_PostList.BindPosts()

at User_controls_PostList.Page_Load(Object sender, EventArgs e)

at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)

at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)

at System.Web.UI.Control.OnLoad(EventArgs e)

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Control.LoadRecursive()

at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

TargetSite : Void BindPosts()

<form id="form1" action="http://localhost:27521/Flower2/default.aspx" method="post">

Latest News

New Website Launched

January 1st, 2010

2010 sees the redesign of our website. Take a look around and let us know what you think.
Read more

Useful Links

Useful Info

You can put anything you like in the sidebar. Latest news, useful links, images, contact information. Anything you think the visitor will find useful.

Welcome to the flowers_2 template

This standards compliant, simple, fixed width website template is released as an 'open source' design (under theCreative Commons Attribution 3.0 Licence), which means that you are free to download and use it for anything you want (including modifying and amending it). All I ask is that you leave the 'design by dcarter' link in the footer of the template, but other than that...

This template is written entirely in XHTML 1.1 and CSS, and can be validated using the links in the footer.

You can view my other 'open source' template designs here.

This template is a fully functional 5 page website, with a styles page that gives examples of all the styles available with this design.

Browser Compatibility

This template has been tested in the following browsers:

  • Internet Explorer 8
  • Internet Explorer 7
  • FireFox 3
  • Google Chrome 2
  • Safari 4
</form>


Aug 31, 2010 at 8:36 PM

Please disregard above, I got this part figured out.

Aug 31, 2010 at 8:38 PM

This is the second "Message" in the exception trace above - this is usually the problem.

Message : Unable to cast object of type 'ASP.PostView' to type 'BlogEngine.Core.Web.Controls.PostViewBase'.

Have you created PostView.ascx and CommentView.ascx for this theme?  Do they extend PostViewBase and CommentViewBase?  The standard themes are a good example of how these two required controls should be built.