Issues trying to create my own site.master to match my site

Topics: Themes
Jan 13, 2010 at 4:40 AM

I have a master file for my current site, i am trying to create one with the themes folder for my blog.

The theme folder has been created and setup and blog works, but trying to apply my look and layout to the master file cause it to error out over little things that i wouldnt think would cause these errors..

Just from my limited testing so far on this, seems that certain html code within my master file will cause the page to display class errors. I added <br /><br /> above the horizontal menu at the top and get this error:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).

Source Error:

 
Line 6:  using System.Web.UI.WebControls;
Line 7:  
Line 8:  public partial class tkblog_themes_LoneStar_site : System.Web.UI.MasterPage
Line 9:  {
Line 10:     protected void Page_Load(object sender, EventArgs e)

Here is the code within my aspx page: Notice the <br /> between the two horizontal menus, if i remove those breaks and upload the file again, everything works.. <font size="2">

 

</font>

<div id="container">
<ul id="navigation-1">
<li><a href="/default.aspx" title="Home">HOME</a></li>
<li><a href="#" title="YARN">YARN</a>
<ul class="navigation-2">
<li><a href="/yarns/swedishyarns/" title="SWEDISH YARN">SWEDISH YARN</a></li>
<li><a href="/yarns/otheryarns/" title="ASSORTED YARN">ASSORTED YARN</a></li>
</ul>
</li>
<li><a href="/accessories/books.aspx" title="BOOKS">BOOKS</a></li>
<li><a href="/equipment/" title="EQUIPMENT">EQUIPMENT</a></li>
<li><a href="/MerinoSkinCare/" title="MERINO SKIN CARE">MERINO SKIN CARE</a></li>
</ul>
</div>
<br />
<br />
<div id="menu">
<ul>
<li><a href="<%=Utils.AbsoluteWebRoot %>" rel="home"><%=Resources.labels.home %></a></li>
<li><a href="<%=Utils.AbsoluteWebRoot %>archive.aspx"><%=Resources.labels.archive %></a></li>
<li><a href="<%=Utils.AbsoluteWebRoot %>contact.aspx"><%=Resources.labels.contact %></a></li>
<li><a href="<%=Utils.FeedUrl %>" class="feed"><img src="<%=Utils.AbsoluteWebRoot %>pics/rssButton.gif" alt="Feed" /><%=Resources.labels.subscribe %></a></li>
<li><a runat="server" id="aLogin" /></li>
</ul>
</div>

<form id="form1" runat="server">

 

Can anyone offer suggestions on how to create my master so i dont get these errors? I mean why would something so basic cause this issue?

Jan 13, 2010 at 6:04 AM

I was able to get around this, not very user friendly to do so, but works.. now that i got my page working, i cant login to the admin section.. i provide my login and password and get a server error. 404 File or Directory not found. what did i do to cause this? all i have been working on is the site.master, no other files have been touched.

Coordinator
Jan 13, 2010 at 6:06 AM

When you get the 404 error, what URL is in the address bar?

Jan 13, 2010 at 6:13 AM

when i click on the "Log In" link in the menu, it refreshed the page and shows the login portion on my page, i provide my login and password and receive the error, The page url never changes.

www.mysite.com/tkblog/login.aspx

This really sets me back some, i thought i was in the clear once i got the page layout to start looking like my site and now this..

Any ideas on things i can check? i mean all changes i have been making tonight are only within the site.master file..

Coordinator
Jan 13, 2010 at 6:19 AM

What version of BE are you using?

Is the 404 error a "standard" IIS 404 error with a plain white BG?  Or is it an error page within the BE layout?

Have you ever been able to log into this blog?  Is it a new blog installation?

You were able to log in before when using the Standard theme?

Sorry about all the questions -- it just sounds a bit strange and trying to understand the situation better.

Jan 13, 2010 at 6:33 AM

Im using Version 1.5 Final

The error page looks like this:

<fieldset>

404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

</fieldset>

I was logged in successfully earlier tonight while i was working on the site.master file. I have been able to login since i installed and configured it up until tonight.

Ask all the questions you need to, i need any help you can give..

thank you

Jan 13, 2010 at 6:37 AM

After your questions and my reply i tried this.. i had my previous version of the site.master file so i deleted the new one i was working on tonight and replaced it with the other and i can login, so did i do something wrong within my new site.master to cause this? It seems that way, but what coudl it be since everything i was working on was merely layout of the controls and code within the page.

thanks again.

Coordinator
Jan 13, 2010 at 6:45 AM

Glad you have it sort of resolved.

The initial error you posted indicates that the "class" name in the site.master file didn't match the class name in the site.master.cs file.  As an example, with the Standard them, here's what it looks like:

site.master
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="site.master.cs" Inherits="StandardSite" %>

site.master.cs
public partial class StandardSite : System.Web.UI.MasterPage

Notice that "StandardSite" in site.master matches "StandardSite" in site.master.cs.

The error message you posted in you original post was indicating tkblog_themes_LoneStar_site did not match in the site.master and site.master.cs files.

At least that's what I gathered from the error message.

Jan 13, 2010 at 6:53 AM

Yea i found a way around that class issue..but now with the login issue, i really need to use my new site.master that has the look and feel of my site. So what can i check within it to find my problem?

i mean the 2 site.master files both contain the same blog controls, only difference is the layout and colors.. but the one with less styling allows me to login, the new one doesnt.