+ Reply to Thread
Results 1 to 10 of 10

Thread: ASP.NET not linking to code behind??

  1. #1
    angrywasp is offline x10Hosting Member angrywasp is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    2

    ASP.NET not linking to code behind??

    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:
    Server Error in '/' Application
    
    Parser Error
    
     Description: Error parsing a resource required to service this request. Review your source file and modify it to fix this error. 
     Error message: 
    Cannot find type _Default
    File name:  /home/stevemed/public_html/Default.aspx
        Line: 1
    Source Error:   <%@ 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">
    
       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

  2. #2
    bugfinder's Avatar
    bugfinder is offline Retired bugfinder is an unknown quantity at this point
    Join Date
    Dec 2007
    Posts
    2,260

    Re: ASP.NET not linking to code behind??

    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.
    :rant2:
    Please do not send me personal messages unless I have requested you to do so.
    Thank you.

    You can join us on irc for support and chat
    2 - connnect to irc either by the web interface or direct irc://irc.x10hosting.com:6667

  3. #3
    Pi606's Avatar
    Pi606 is offline x10Hosting Member Pi606 is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Stoli
    Posts
    85

    Re: ASP.NET not linking to code behind??

    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.



  4. #4
    oracle is offline x10 Lieutenant oracle is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    430

    Re: ASP.NET not linking to code behind??

    This basic code works perfect for me:

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

  5. #5
    jgrey1 is offline x10Hosting Member jgrey1 is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    13

    Re: ASP.NET not linking to code behind??

    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.

  6. #6
    madhead is offline x10Hosting Member madhead is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    4

    Re: ASP.NET not linking to code behind??

    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 :-)

  7. #7
    Pi606's Avatar
    Pi606 is offline x10Hosting Member Pi606 is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Stoli
    Posts
    85

    Re: ASP.NET not linking to code behind??

    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.



  8. #8
    madhead is offline x10Hosting Member madhead is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    4

    Re: ASP.NET not linking to code behind??

    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 by madhead; 06-27-2008 at 04:30 PM. Reason: Automerged Doublepost

  9. #9
    buddy218 is offline x10Hosting Member buddy218 is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    30

    Re: ASP.NET not linking to code behind??

    does x10hosting even support asp.net?
    My Web Site: http://clanminers.net/
    My Web Site's Forum: http://forums.clanminers.net/
    Play RuneScape? Want To Join A Clan For RuneScape? The Come To My Site And Join My Clan.
    My Clans Radio: http://cmr.clanminers.net/

  10. #10
    madhead is offline x10Hosting Member madhead is an unknown quantity at this point
    Join Date
    Jun 2008
    Posts
    4

    Re: ASP.NET not linking to code behind??

    Yes they do. Hence this thread.

+ Reply to Thread

Similar Threads

  1. Hybrid's HTML Lessons
    By Hybrid in forum Tutorials
    Replies: 18
    Last Post: 11-28-2009, 02:12 PM
  2. BB Code Guide
    By Jober68 in forum Tutorials
    Replies: 1
    Last Post: 01-10-2008, 05:12 PM
  3. PHP Linking & Mod_Rewrite Tutorials
    By coolv1994 in forum Programming Help
    Replies: 3
    Last Post: 12-27-2007, 07:19 PM
  4. New x10 ad code
    By yahia in forum Feedback and Suggestions
    Replies: 23
    Last Post: 01-02-2007, 12:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers