UPDATE: I think my host configured my space with ASP.NET 1.1 instead of 2.0! I’ll see if switching that fixes the problem.
I’m just beginning to learn C# and ASP.NET 2.0, and I’m find myself running into a serious roadblock. Since I’m new to both C# and .NET it’s very hard for me to troubleshoot the problem, and even days of searching the net for a clue has proven fruitless.
I’m working through some tutorials found on ASP.NET, but I am stuck at ‘codebehind’.
I can get any example to work locally (of course), but I’m finding that I can not get anything to work remotely on my new shared hosting plan.
The error:
[B]Parser Error Message: Could not load the assembly 'App_Web_???????'. Make sure that it is compiled before accessing the page.[/B]
Source Error:
Line 1: <%@ page language="VB" masterpagefile="~/Default.master" title="Your Name Here | Home" inherits="Default_aspx, App_Web_gphmnbth" stylesheettheme="White" %>
Line 2:
Line 3: <asp:content id="Content1" contentplaceholderid="Main" runat="server">
I have a very simple application with a single codebehind file. Here is the code for default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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>Untitled Page</title>
<link id="Link1" runat="server" rel="stylesheet" href="/css/layout.css" media="screen" />
<link id="Link2" runat="server" rel="stylesheet" href="/css/style.css" media="screen" />
</head>
<body>
<div id="layout">
<div id="header"><h1>Sovereign Order</h1></div>
<div id="global_nav"></div>
<div id="columns">
<div id="Col_Left">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In vehicula massa sed quam. Nunc vehicula nisl vel magna. Sed in sapien non neque iaculis molestie. Donec fermentum, elit non ultricies dapibus, sem magna tempus nibh, a semper tellus libero nec dolor. Ut molestie, erat ac eleifend ullamcorper, est urna pellentesque dolor, id venenatis metus ante sed neque.</p>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In vehicula massa sed quam. Nunc vehicula nisl vel magna. Sed in sapien non neque iaculis molestie. Donec fermentum, elit non ultricies dapibus, sem magna tempus nibh, a semper tellus libero nec dolor. Ut molestie, erat ac eleifend ullamcorper, est urna pellentesque dolor, id venenatis metus ante sed neque.</p>
</div>
<div id="Col_Center">
<div id="news">w
<form id="Form1" runat="server">
<h1>Welcome to ASP.NET 2.0!</h1>
<b>Enter Your Name:</b>
<asp:TextBox ID="TextBox1" Runat="server"/>
<asp:Button ID="Button1" Text="Click Me" OnClick="Button1_Click" Runat="server"/>
<br />
<br />
<asp:Label ID="Label1" Text="Hello" Runat="server" />
</form>
</div>
</div>
<div class="clear"><!-- --></div>
</div>
</div>
</body>
</html>
The code for default.aspx.cs:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "Hello " + TextBox1.Text;
}
}
Couple of items of interest:
-
I am publishing the site to a local folder, deleting the remote folder entirely, and uploading the local published folder in its entirety (including /bin/*) before each test.
-
I’m new enough to all of this that particular lines of code (such as the “using” statements) are only there becaues they were in the example, not because I understand it.
-
I have tried uploading the compiled files to both my root directory and a subfolder that I have specifically designated as an application starting point. Either way I recieve the error
-
I’ve tried a couple starter projects from Microsoft and I receive the same error.
Is there anyone out there that might have an idea why I’m recieving the error?