[Mono-dev] Controls in HTML comment block behave different in .Net and Mono
Alexandre Miguel Pedro Gomes
alexmipego at gmail.com
Fri Feb 3 10:00:16 EST 2006
MS.Net is always the right behaviour, even if unlogic or buggy. I guess
thats the mono ASP.Net parser ignoring everything placed between comments...
seems like the behaviour should be process it but don't show it.
On 2/5/06, Arnhoffer Károly <karnhoffer at ecron.hu> wrote:
>
> Hi,
>
> When I have an ASP.Net control in an HTML comment block of an aspx page it
> does not compile under Mono but it does compile under .Net.
>
> Exmple aspx:
>
> <%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
> AutoEventWireup="false" Inherits="MonoCharsetTest.WebForm1" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> <HTML>
> <HEAD>
> <title>WebForm1</title>
> <meta name="GENERATOR" Content="Microsoft Visual Studio
> 7.0">
> <meta name="CODE_LANGUAGE" Content="C#">
> <meta name="vs_defaultClientScript" content="JavaScript">
> <meta name="vs_targetSchema" content="
> http://schemas.microsoft.com/intellisense/ie5">
> <meta name="Content-Type" content="text/html;
> charset=utf-8">
> </HEAD>
> <body>
> <form id="Form1" method="post" runat="server">
> <!--
> <INPUT id="Button1" type="button" value="Button"
> name="Button1" runat="server">
> -->
> </form>
> </body>
> </HTML>
>
> Example cs:
>
> using System;
> using System.Collections;
> using System.ComponentModel;
> using System.Data;
> using System.Drawing;
> using System.Web;
> using System.Web.SessionState;
> using System.Web.UI;
> using System.Web.UI.WebControls;
> using System.Web.UI.HtmlControls;
>
> namespace MonoCharsetTest
> {
> /// <summary>
> /// Summary description for WebForm1.
> /// </summary>
> public class WebForm1 : System.Web.UI.Page
> {
> protected System.Web.UI.HtmlControls.HtmlInputButtonButton1;
>
> private void Page_Load(object sender, System.EventArgs e)
> {
> // Put user code to initialize the page here
> Button1.Value="Hello";
> }
>
> #region Web Form Designer generated code
> override protected void OnInit(EventArgs e)
> {
> //
> // CODEGEN: This call is required by the ASP.NETWeb Form Designer.
> //
> InitializeComponent();
> base.OnInit(e);
> }
>
> /// <summary>
> /// Required method for Designer support - do not modify
> /// the contents of this method with the code editor.
> /// </summary>
> private void InitializeComponent()
> {
> this.Load += new System.EventHandler(
> this.Page_Load);
>
> }
> #endregion
>
> }
> }
>
> Results when running on mono:
>
> Server error in '/c' application
>
>
> --------------------------------------------------------------------------------
>
> Description: Error processing request.
> Error Message: HTTP 500.
>
> Stack Trace: System.NullReferenceException: Object reference not set to an
> instance of an object
> in <0x00012> MonoCharsetTest.WebForm1:Page_Load (System.Object sender,
> System.EventArgs e)
> in (wrapper delegate-invoke)
> System.MulticastDelegate:invoke_void_object_EventArgs (object,
> System.EventArgs)
> in <0x00117> System.Web.UI.Control:OnLoad (System.EventArgs e)
> in <0x000e5> System.Web.UI.Control:LoadRecursive ()
> in <0x0011e> System.Web.UI.Page:InternalProcessRequest ()
> in <0x000a4> System.Web.UI.Page:ProcessRequest (System.Web.HttpContextcontext)
>
> With .Net I get a page without the button and no compilation error.
>
> Wich is the right behaviour?
> VS.Net project, Mono and .Net results are attached.
>
> Thanks!
>
> Károly
>
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
>
>
--
Alexandre Gomes, Portugal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060203/c2790f5b/attachment.html
More information about the Mono-devel-list
mailing list