ASP.net is run under mono on a linux server, so there are some considerations you need to keep in mind.
.net 2.0 is fully supported, have not tested 3.5 or 4, though technically those should be supported, since the mono version is 2.6
filenames are case sensitive under linux, so default.aspx.cs is not the same as Default.aspx.cs
Use forward-slash /////// when accessing stuff(IE: File.ReadAllLines("./data/SomeDirectories/MoreStuff/someData.xml"))
Otherwise your scripts should work.
The tutorial linked has a couple issues
Here is a modified snippet of the tutorial with fixes:
Make sure to use the file names exactly as shown
Code:
<!-- this line is for C# projects -->
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="HelloWorld.aspx.cs" Inherits="HelloWorld" %>
Or
Code:
<!-- this line is for VB.Net projects -->
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="HelloWorld.aspx.vb" Inherits="HelloWorld" %>
And this is the rest of xhtml for both languages:
Code:
<!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>Hello World!</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Erm, Hello World!"></asp:Label>
<br /> <br />
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Press Me" />
</div>
</form>
</body>
</html>
That’s the html sorted. Now on to the code-behind file.
C# HelloWorld.aspx.cs:
Code:
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class HelloWorld: System.Web.UI.Page
{
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = "Asp.Net post test worked.";
}
}
Or
VB.Net HelloWorld.aspx.vb
Code:
Partial Class HelloWorld
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
Label1.Text = "ASP.Net post test Worked"
End Sub
End Class