RE: [Mono-list] ASP.NET sample page

2005-11-30 Thread Chris Aitken
  By Changing the Codebehind to a Src mono knows to compile 
 the .aspx.cs 
  page Just In Time.
  
 Ok, thanks, that works fine. My question is: how does 
 apache/mod-mono-server know that the .cs file has been 
 changed? Does it build the assembly everytime index.aspx is 
 called? How does it work?

Hi Jurek,

Glad it worked for you!

From experience, it doesn't. There is supposed to be xcopy updating - i.e.
mod-mono-server knows if a new dll has been copied over etc.
What you'll have to do (once your .cs file is updated) is restart the
mod-mono-server. There are instructions on the mod-mono page [1] at the site
about how to do this. It's fairly simple.

Hope this helps,

Chris

[1] http://www.mono-project.com/Mod_mono#Control_panel


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] ASP.NET sample page

2005-11-29 Thread Jurek Bartuszek
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160

Hi!

I'm trying to run an example asp.net page, but I get an error:

Server Error in '/~koxta' 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 SimpleWebApp.SimplePage

File name: /home/koxta/public_html/aspnet/example1/index.aspxLine: 1

Source Error:

%@ Page language=c# Codebehind=index.aspx.cs
Inherits=SimpleWebApp.SimplePage AutoEventWireup=false%
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN 
HTML
   HEAD

The index.aspx and index.aspx.cs files are located in
~koxta/public_html/aspnet/example1

Am I missing something? Isn't mod-mono-server compiling the .cs file by
itself?

Here are the sources:

[EMAIL PROTECTED]:~/public_html/aspnet/example1$ ls
index.aspx  index.aspx.cs

[EMAIL PROTECTED]:~/public_html/aspnet/example1$ cat index.aspx
%@ Page language=c# Codebehind=index.aspx.cs
Inherits=SimpleWebApp.SimplePage AutoEventWireup=false%
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN 
HTML
   HEAD
  titleSimple Page/title
   /HEAD
   body
  form method=post runat=server
 table width=450px border=1px
tr
   td colspan=2strongServer Details/strong/td
/tr
tr
   tdServer Name:/td
   td
  asp:Label id=serverName
runat=server/asp:Label/td
/tr
tr
   tdOperating System:/td
   td
  asp:Label id=operatingSystem
runat=server/asp:Label
   /td
/tr
tr
   tdOperating System Version:/td
   td
  asp:Label id=operatingSystemVersion runat=server
  /asp:Label
   /td
/tr
 /table
 br
 table width=450px border=1px
tr
   td colspan=2strongRequest Details/strong/td
/tr
tr
   tdPage Requested:/td
   td
  asp:Label id=requestedPage runat=server/asp:Label
   /td
/tr
tr
   tdRequest From:/td
   td
  asp:Label id=requestIP runat=server/asp:Label
   /td
/tr
tr
   tdUser Agent:/td
   td
  asp:Label id=requestUA runat=server/asp:Label
   /td
/tr
 /table
  /form
   /body
/HTML

[EMAIL PROTECTED]:~/public_html/aspnet/example1$ cat index.aspx.cs
using System;
using System.Web.UI.WebControls;

namespace SimpleWebApp
{
public class SimplePage : System.Web.UI.Page
{
protected Label operatingSystem;
protected Label operatingSystemVersion;
protected Label requestedPage;
protected Label requestIP;
protected Label requestUA;
protected Label serverName;

protected override void OnLoad(EventArgs e)
{
DisplayServerDetails();
DisplayRequestDetails();
base.OnLoad (e);
}

private void DisplayServerDetails()
{
serverName.Text = Environment.MachineName;
operatingSystem.Text =
Environment.OSVersion.Platform.ToString();
operatingSystemVersion.Text =
Environment.OSVersion.Version.ToString();
}

private void DisplayRequestDetails()
{
requestedPage.Text = Request.Url.AbsolutePath;
requestIP.Text = Request.UserHostAddress;
requestUA.Text = Request.UserAgent;
}
}
}

Best regards,

Jurek Bartuszek
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDjJ0K6l8uJkeTVlMRA9TaAJ4zPAzT9IvJQTQHm0dnJNR1tvKtVQCdHsYh
kBdV0gBNe3MMO4MqAMPnD2A=
=eXKB
-END PGP SIGNATURE-
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


RE: [Mono-list] ASP.NET sample page

2005-11-29 Thread Chris Aitken
 Hi!
 
 I'm trying to run an example asp.net page, but I get an error:
 
 Server Error in '/~koxta' 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 SimpleWebApp.SimplePage
 
 File name: /home/koxta/public_html/aspnet/example1/index.aspx 
Line: 1
 
 Source Error:
 
 %@ Page language=c# Codebehind=index.aspx.cs 
 Inherits=SimpleWebApp.SimplePage AutoEventWireup=false% 
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN  HTML
HEAD
 
 The index.aspx and index.aspx.cs files are located in 
 ~koxta/public_html/aspnet/example1
 
 Am I missing something? Isn't mod-mono-server compiling the 
 .cs file by itself?

Codebehind is a Visual Studio thing. Either precompile the .aspx.cs page,
and stick the .bin into the ~/bin/ folder, or change the 'Codebehind=' into
a 'Src='

By Changing the Codebehind to a Src mono knows to compile the .aspx.cs page
Just In Time.

HTH

Chris


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list