Asp.Net

Status
Not open for further replies.

arpanet

New Member
Messages
1
Reaction score
0
Points
0
i made website muhammad.x10hosting.com
but my asp.net webpages are not working even i uploaded some of my asp.net pages
could you plaese turn on my asp.net scrip or language to my hosting
or can you tell how can i configure my asp.net on my hosting

muhammad.x10hosting.com/Default.aspx

waiting for your reply
 

masshuu

Head of the Geese
Community Support
Enemy of the State
Messages
2,293
Reaction score
50
Points
48
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
 
Status
Not open for further replies.
Top