Magiccity33
asked on
ASP.Net (VB.Net) Compilation Error (Parser Error ) Unable to load type
Hello,
I recently uploaded an ASP.NET site to GoDaddy and wanted to test the website to ensure that everything looked ok. Well things working just fine on my laptop but when I try an run the site on GoDaddy I receive the following error:
All of the aspx files are located in the root directory as well as the master page.
What is causing this issue? On my laptop the directory is CharWeb/CharWeb/ then the files but on Godaddy I only have the root directory (html) then the actual website files.
Here is the actual code for the masterpage CharSite.Master:
The CharSite.Designer file:
And the CharSite.Master.vb CodeBehind:
I recently uploaded an ASP.NET site to GoDaddy and wanted to test the website to ensure that everything looked ok. Well things working just fine on my laptop but when I try an run the site on GoDaddy I receive the following error:
Parser Error Message: Could not load type 'CharWeb.CharSite'.
Source Error:
Line 1: <%@ Master Language="VB" AutoEventWireup="false" CodeBehind="~/CharSite.Master.vb" Inherits="CharWeb.CharSite" %>
All of the aspx files are located in the root directory as well as the master page.
What is causing this issue? On my laptop the directory is CharWeb/CharWeb/ then the files but on Godaddy I only have the root directory (html) then the actual website files.
Here is the actual code for the masterpage CharSite.Master:
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="CharSite.Master.vb" Inherits="CharWeb.CharSite" %>
<!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">
<title></title>
<style type="text/css">
.style1
{
width: 785px;
}
.style2
{
width: 53px;
}
.style4
{
width: 88px;
}
.style5
{
width: 683px;
}
.style7
{
width: 175px;
}
.style8
{
width: 164px;
}
.style9
{
width: 130px;
}
.style10
{
width: 148px;
}
.style11
{
width: 176px;
}
.style12
{
width: 1003px;
}
</style>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />
<div>
<div id="header" >
<table>
<tr>
<td class="style2">
</td>
<td class="style12">
</td>
<td class="style1">
<asp:Image ID="CharLogoImg" runat="server"
ImageUrl="~/Images/Char_Productions_blk.png" />
</td>
<td class="style5">
</td>
</tr>
</table>
</div>
<div id="menu">
<table>
<tr>
<td class="style11">
</td>
<td class="style7">
<asp:LinkButton ID="HomeLinkButton" runat="server" CssClass="linkButtonHover"
PostBackUrl="~/Default.aspx" ForeColor="#EE9926">Home</asp:LinkButton>
</td>
<td class="style8">
<asp:LinkButton ID="AboutUsLinkButton" runat="server" CssClass="linkButton"
PostBackUrl="~/about.aspx" ForeColor="#EE9926">About Us</asp:LinkButton>
</td>
<td class="style9">
<asp:LinkButton ID="EventsLinkButton" runat="server" CssClass="linkButton"
PostBackUrl="~/charevents.aspx" ForeColor="#EE9926">Events</asp:LinkButton>
</td>
<td class="style10">
<asp:LinkButton ID="WeddingsLinkButton" runat="server" CssClass="linkButton"
PostBackUrl="~/weddings.aspx" ForeColor="#EE9926">Weddings</asp:LinkButton>
</td>
<td class="style4">
<asp:LinkButton ID="ContactUsLinkButton" runat="server" CssClass="linkButton"
PostBackUrl="~/contactus.aspx" ForeColor="#EE9926">Contact Us</asp:LinkButton>
</td>
</tr>
</table>
</div>
<div id="breadcrumbs">
</div>
<div id="content">
<asp:ContentPlaceHolder ID="CPH1" runat="server">
<br />
</asp:ContentPlaceHolder>
</div>
</div>
</form>
</body>
</html>
The CharSite.Designer file:
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Partial Public Class CharSite
'''<summary>
'''form1 control.
'''</summary>
'''<remarks>
'''Auto-generated field.
'''To modify move field declaration from designer file to code-behind file.
'''</remarks>
Protected WithEvents form1 As Global.System.Web.UI.HtmlControls.HtmlForm
'''<summary>
'''SiteMapDataSource1 control.
'''</summary>
'''<remarks>
'''Auto-generated field.
'''To modify move field declaration from designer file to code-behind file.
'''</remarks>
Protected WithEvents SiteMapDataSource1 As Global.System.Web.UI.WebControls.SiteMapDataSource
'''<summary>
'''CharLogoImg control.
'''</summary>
'''<remarks>
'''Auto-generated field.
'''To modify move field declaration from designer file to code-behind file.
'''</remarks>
Protected WithEvents CharLogoImg As Global.System.Web.UI.WebControls.Image
'''<summary>
'''HomeLinkButton control.
'''</summary>
'''<remarks>
'''Auto-generated field.
'''To modify move field declaration from designer file to code-behind file.
'''</remarks>
Protected WithEvents HomeLinkButton As Global.System.Web.UI.WebControls.LinkButton
'''<summary>
'''AboutUsLinkButton control.
'''</summary>
'''<remarks>
'''Auto-generated field.
'''To modify move field declaration from designer file to code-behind file.
'''</remarks>
Protected WithEvents AboutUsLinkButton As Global.System.Web.UI.WebControls.LinkButton
'''<summary>
'''EventsLinkButton control.
'''</summary>
'''<remarks>
'''Auto-generated field.
'''To modify move field declaration from designer file to code-behind file.
'''</remarks>
Protected WithEvents EventsLinkButton As Global.System.Web.UI.WebControls.LinkButton
'''<summary>
'''WeddingsLinkButton control.
'''</summary>
'''<remarks>
'''Auto-generated field.
'''To modify move field declaration from designer file to code-behind file.
'''</remarks>
Protected WithEvents WeddingsLinkButton As Global.System.Web.UI.WebControls.LinkButton
'''<summary>
'''ContactUsLinkButton control.
'''</summary>
'''<remarks>
'''Auto-generated field.
'''To modify move field declaration from designer file to code-behind file.
'''</remarks>
Protected WithEvents ContactUsLinkButton As Global.System.Web.UI.WebControls.LinkButton
'''<summary>
'''CPH1 control.
'''</summary>
'''<remarks>
'''Auto-generated field.
'''To modify move field declaration from designer file to code-behind file.
'''</remarks>
Protected WithEvents CPH1 As Global.System.Web.UI.WebControls.ContentPlaceHolder
End Class
And the CharSite.Master.vb CodeBehind:
Public Class CharSite
Inherits System.Web.UI.MasterPage
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
HomeLinkButton.ForeColor = Drawing.Color.Red
End Sub
Protected Sub HomeLinkButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles HomeLinkButton.Click
If HomeLinkButton.CssClass = ".linkButton" Then
HomeLinkButton.CssClass = ".linkButtonHover"
WeddingsLinkButton.CssClass = ".linkButton"
EventsLinkButton.CssClass = ".linkButton"
ContactUsLinkButton.CssClass = ".linkButton"
AboutUsLinkButton.CssClass = ".linkButton"
Else
HomeLinkButton.CssClass = ".linkButton"
End If
End Sub
Protected Sub AboutUsLinkButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles AboutUsLinkButton.Click
If AboutUsLinkButton.CssClass = ".linkButton" Then
AboutUsLinkButton.CssClass = ".linkButtonHover"
WeddingsLinkButton.CssClass = ".linkButton"
EventsLinkButton.CssClass = ".linkButton"
ContactUsLinkButton.CssClass = ".linkButton"
HomeLinkButton.CssClass = ".linkButton"
Else
AboutUsLinkButton.CssClass = ".linkButton"
End If
End Sub
Protected Sub EventsLinkButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EventsLinkButton.Click
If EventsLinkButton.CssClass = ".linkButton" Then
EventsLinkButton.CssClass = ".linkButtonHover"
WeddingsLinkButton.CssClass = ".linkButton"
HomeLinkButton.CssClass = ".linkButton"
ContactUsLinkButton.CssClass = ".linkButton"
AboutUsLinkButton.CssClass = ".linkButton"
Else
EventsLinkButton.CssClass = ".linkButton"
End If
End Sub
Protected Sub WeddingsLinkButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles WeddingsLinkButton.Click
If WeddingsLinkButton.CssClass = ".linkButton" Then
Weddingslinkbutton.CssClass = ".linkButtonHover"
HomeLinkButton.CssClass = ".linkButton"
EventsLinkButton.CssClass = ".linkButton"
ContactUsLinkButton.CssClass = ".linkButton"
AboutUsLinkButton.CssClass = ".linkButton"
Else
WeddingsLinkButton.CssClass = ".linkButton"
End If
End Sub
Protected Sub ContactUsLinkButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles ContactUsLinkButton.Click
If ContactUsLinkButton.CssClass = ".linkButton" Then
ContactusLinkButton.CssClass = ".linkButtonHover"
WeddingsLinkButton.CssClass = ".linkButton"
EventsLinkButton.CssClass = ".linkButton"
HomeLinkButton.CssClass = ".linkButton"
AboutUsLinkButton.CssClass = ".linkButton"
Else
ContactUsLinkButton.CssClass = ".linkButton"
End If
End Sub
End Class
ASKER
Went into the Charsite class and in the codebehind added the imports CharWeb namespace but I am still receiving the error on goDaddy. Again everything runs on my laptop but not on their servers. Also tried removing CharWeb from the inherits statement, but that did not work either. This is weird as I did both of those before submitting to experts-exchange for assistance. What else could possibly be wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
After doing more research I decided to not only take the suggestion of CodeCruiser but also changed CodeBehind to CodeFile in the page directive and everything works now.
Thanks for the quick response
Thanks for the quick response
You are missing the namespace. Either add the namespace charweb in your charsite class or change the above to
Inherits="CharSite"