ASP.NET not linking to code behind??

angrywasp

New Member
Messages
2
Reaction score
0
Points
0
Hi all,
I was wanting to create and ASP.NET website on x10 but i am having a bit of a problem. I just created the default asp.net website in visual studio and uploaded it as a test but i am getting an error. Here is the code for the default.aspx page

Code:
<%@ 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>Steve's ASP.NET Site Test</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    Testing x10's ASP.NET hosting capability
    </div>
    </form>
</body>
</html>
and here is the code for default.aspx.cs:

Code:
using System;
using System.Web.UI;

public partial class _Default : Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}
as you can see it is pretty basic. but i am getting the following error, as you can see on the site
http://www.stevemedley.x10hosting.com/

Code:
[B]Server Error in '/' Application[/B]

[B][I]Parser Error[/I][/B]

 [B]Description: [/B]Error parsing a resource required to service this request. Review your source file and modify it to fix this error. 
 [B]Error message: [/B]
Cannot find type _Default
[B]File name: [/B] /home/stevemed/public_html/Default.aspx
    [B]Line: [/B]1
[B]Source Error: [/B]  [COLOR=red]<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
[/COLOR]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

   05/20/2008 12:43:31
Obviously _Default exists. Is this something to do with mono? the page runs fine on my local machine.

I am on the Lotus server on an ad free package, which from what i have read supports ASP.NET and i believe if it didn't i wouldn't even get this far.

So any help would be appreciated. If there is any other info you need, just let me know
 

bugfinder

Retired
Messages
2,260
Reaction score
0
Points
0
Im not an asp.net guru, far from it, in fact never wrote some in my life..

But

I went to http://www.go-mono.com/mono-downloads/download.html grabbed me the vmware image and had a fiddle

Your pages do work but only if I make a webapp file with the mono config in it.. and it knew where to find it, I blieve then this maybe better off in the programming language section.
 

Pi606

New Member
Messages
85
Reaction score
0
Points
0
If you do not use external code--that is, include your C# code in the page, you will not have a problem.

Other than that, here's a possible solution:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Server.MapPath(Default.aspx.cs)" Inherits="_Default" %>

or:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="~/Default.aspx.cs" Inherits="_Default" %>

Worked on a similar problem, but not the exact same problem. Maybe it'll work here too.
 

oracle

New Member
Messages
430
Reaction score
0
Points
0
This basic code works perfect for me:

Code:
[B]<%@ Page Language="C#" %>[/B]
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
[B][B]<script runat="server">[/B][/B]
 
    protected [I]void[/I] Page_Load(object sender, EventArgs e)
    {
        Label1.Text = DateTime.Now.ToLongDateString();
    }
 
[B][B]</script>[/B][/B]
 
[B]<html xmlns="http://www.w3.org/1999/xhtml" >[/B]
[B]<head runat="server">[/B]
    [B]<title>[/B]Sample page[B]</title>[/B]
[B]</head>[/B]
[B]<body>[/B]
    [B][U]<form id="form1" runat="server">[/U][/B]
    [B]<div>[/B]
        [B]<asp:Label runat="server" id="Label1" />[/B]
    [B]</div>[/B]
    [B][U]</form>[/U][/B]
 
[B]</body>[/B]
[B]</html>[/B]
 

jgrey1

New Member
Messages
13
Reaction score
0
Points
0
You should always put your code in e.g. an insert file so that your source code is not shown when .net fails to execute.
 

madhead

New Member
Messages
4
Reaction score
0
Points
0
You are attempting to write ASP.NET 2 code. The version running on this hosting server (lotus??) is only version 1.1. it would be mighty handy if this was upgraded to 2.0:). 1.1 is way out of date now really. Main trouble of course is that the 2.0 branch isn't quite there yet. (1.9.1 ish). I would be very happy to see 2.0 on here :)
 

Pi606

New Member
Messages
85
Reaction score
0
Points
0
If he's using Visual Web Developer 2008, there's no way to downgrade to .NET 1.1

This topic is over two weeks old, so I don't know if he has found a solution or not.
 

madhead

New Member
Messages
4
Reaction score
0
Points
0
If he is using 2008, when creating a new page just uncheck the use code behind check box and he can create the single file as you suggested. Really would be very cool to get the 2.0 branch running on here though :)
Edit:
I found this link to the recent cpanel conference which details how to setup mono 2.0 using cpanel, so it is possible :)

http://www.cpanel.net/conference/08/files/Modmono.pdf
 
Last edited:
Top