[Mono-dev] System.Web.Extension

Konstantin Triger kostat at mainsoft.com
Wed Aug 29 03:07:52 EDT 2007


Hello Onur,

 

- You told me current version in  svn is working. But is it working under xsp2/mono ? Or only tested under windows ?

It works under our environment, where all the runtime is mono based (compiled to java bytecode), except aspx parser, which is taken from MS.Net and low level corlib stuff, that is unrelated.

 

- As you know currently monodevelop does not support partial page classes for asp.net development. So we need to use "Code Behind" (Asp.net 1.1 style) instead of "Code Beside". Is this still ok?

Sys.Web.Extension is a usual class library, after all. You should be able to use it in every way supported by Sys.Web (aspx parser functionality).

 

- My final program is as below and I am getting a nasty null pointer exception:

I suppose it's a bug in aspx parser, which was identified by Igor Zelmanovich few days ago (mail attached).

 

Regards,

Konstantin Triger

________________________________

From: Onur Gumus [mailto:emperon at gmail.com] 
Sent: Tuesday, August 28, 2007 9:00 PM
To: Konstantin Triger
Cc: Miguel de Icaza; Raja R Harinath; mono-devel-list at lists.ximian.com
Subject: Re: [Mono-dev] System.Web.Extension

 

Hello 

- The name space thingy seemed to be my error so I fixed it.

- You told me current version in  svn is working. But is it working under xsp2/mono ? Or only tested under windows ?


- As you know currently monodevelop does not support partial page classes for asp.net development. So we need to use "Code Behind" (Asp.net 1.1 style) instead of "Code Beside". Is this still ok?

- My final program is as below and I am getting a nasty null pointer exception: 

<%@ Page Language="C#" Inherits="test55.xx" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server"> 
  
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager> 
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <fieldset>
                <legend>UpdatePanel</legend> 
                <asp:Label ID="Label1" runat="server" Text="Panel created."></asp:Label><br />
                </fieldset>
            </ContentTemplate> 
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="Button1" />
            </Triggers>
        </asp:UpdatePanel>
        <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div> 
    </form>
    
</body>
</html>



And Code behind as


using System;
using System.Web;
using System.Web.UI;

namespace test55
{
    public  class xx : Page 
    {
        protected System.Web.UI.HtmlControls.HtmlForm form1;
        protected System.Web.UI.WebControls.Button Button1;
        protected System.Web.UI.WebControls.Label Label1;

        protected void Button1_Click(object sender, EventArgs e) 
            {
            try{
                
                Label1.Text="ehlo";
            }catch (Exception ex)
            {
                Console.Write( ex + ex.StackTrace + ex.Message );
            }
                    
        }
    
    }
}

The exception I am getting is:
System.NullReferenceException:  at test55.xx.Button1_Click (System.Object sender, System.EventArgs e) [0x00000]   at test55.xx.Button1_Click (System.Object sender, System.EventArgs e) [0x00000] Object reference not set to an instance of an objectoboSystem.NullReferenceException: Object reference not set to an instance of an object


It seems Label is not recognized as being initialized even if the same ID exists in aspx file. This is why I get an exception. When I remove ajax stuff it works fine.

Any ideas ?








On 8/28/07, Konstantin Triger <kostat at mainsoft.com> wrote:

Hello all,

 

Here at Mainsoft we have ajax toolkit running without problems on the latest version of Sys.Web.Extensions. If you fail loading asp:TextBox, probably, there is a bug in aspx parser. As a workaround I would suggest registering ajax controls to another namespace, i.e:

 

<pages>
    <controls>
      <add tagPrefix="ajax" namespace=" System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </controls>
  </pages>

 

In addition, ensure the assembly information is correct (version,PublicKeyToken).

 

Regards,

Konstantin Triger

________________________________

From: Onur Gumus [mailto:emperon at gmail.com] 
Sent: Tuesday, August 28, 2007 9:46 AM
To: Miguel de Icaza
Cc: Konstantin Triger; Raja R Harinath; mono-devel-list at lists.ximian.com
Subject: Re: [Mono-dev] System.Web.Extension

 

I've checked out the code from svn and compiled with Miguel's make file. So far so good. But when I add the dll to my project and configure my Web.config as of Microsoft wise (you , you have to type bunch of lines to your web.config)  I got type not found error messages for asp:TextBox and so on. You know both System.Web.Extension.dll and System.Web.dll implements the same namespace Syste.Web.UI and according to the MS specs we need to use both of them with asp prefix. 

Finally MS specs suggest we should never use the dll directly rather than we ought to use them via GAC which is somewhat contraversial to what Miguel said.

Is there any simple example how to configure web.config and a small aspx page to see if I am doing something wrong ?

This one is mine

<%@ Page Language="C#" Inherits="test55.xx" %>

<html>
<head>
  <title>xx</title> 
</head>
<body>
  <form id="form1" runat="server">
  <asp:ScriptManager id="AdminScriptManager" runat="server" />^M

    <asp:TextBox id="textBox1" runat="server"/> 
    <asp:Button id="button1" runat="server" OnClick="onButtonClick"/>

  </form>
</body>
</html>


<?xml version="1.0"?> 
 

<configuration>
  <configSections>
    <sectionGroup name="system.web.extensions" 
        type="System.Web.Configuration.SystemWebExtensionsSectionGroup, 
        System.Web.Extensions , Version=1.0.61025.0, Culture=neutral, 
        PublicKeyToken=31bf3856ad364e35">
      <sectionGroup name="scripting" 
        type="System.Web.Configuration.ScriptingSectionGroup, 
        System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, 
        PublicKeyToken=31bf3856ad364e35">
          <section name="scriptResourceHandler" 
            type="System.Web.Configuration.ScriptingScriptResourceHandlerSection , 
            System.Web.Extensions, Version=1.0.61025.0, 
            Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
            requirePermission="false" 
            allowDefinition="MachineToApplication"/> 
        <sectionGroup name="webServices" 
            type="System.Web.Configuration.ScriptingWebServicesSectionGroup, 
            System.Web.Extensions, Version=1.0.61025.0, 
            Culture=neutral, PublicKeyToken=31bf3856ad364e35"> 
          <section name="jsonSerialization" 
              type="System.Web.Configuration.ScriptingJsonSerializationSection, 
              System.Web.Extensions, Version=1.0.61025.0, 
              Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
              requirePermission="false" allowDefinition="Everywhere" />
          <section name="profileService" 
              type="System.Web.Configuration.ScriptingProfileServiceSection , 
              System.Web.Extensions, Version=1.0.61025.0, 
              Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
              requirePermission="false" 
              allowDefinition="MachineToApplication" /> 
          <section name="authenticationService" 
              type="System.Web.Configuration.ScriptingAuthenticationServiceSection, 
              System.Web.Extensions, Version=1.0.61025.0, 
              Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
              requirePermission="false" 
              allowDefinition="MachineToApplication" />
        </sectionGroup> 
      </sectionGroup>
    </sectionGroup>
  </configSections>
 
 
 <system.web>
  <pages>
    <controls>
      <add tagPrefix="asp" namespace=" System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </controls>
  </pages>
  
   <httpModules>
    <add name="ScriptModule" type=" System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
  </httpModules>
  
  <httpHandlers>
    <remove verb="*" path="*.asmx"/> 
    <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
    <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
    <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/> 
  </httpHandlers>
  
</system.web>
  
  
</configuration>





On 8/27/07, Miguel de Icaza <miguel at novell.com > wrote: 

	Hello,
	
	   [ This is a suggestion partially for Hari, who is starting to 
	     dip his feet in ASP.NET ]
	
	> > Is the mono version of System.Web.Extension.dll usable from svn ?
	> Yes. (Though not completely finished).
	>
	> > I tried it and I am unable to use it the same of Microsoft's. 
	> Please post the concrete problems you faced.
	
	I think that we should try to try to get the ASP.NET AJAX Control
	Toolkit that Microsoft has open sourced to run on Mono, and to try to 
	run their sample applications with it.
	
	The toolkit is here:
	
	        http://asp.net/ajax/control-toolkit/live/




-- 
Warning: If you are reading this then this warning is for you. Every word you read of this useless fine print is another second off your life. Don't you have other things to do? Is your life so empty that you honestly can't think of a better way to spend these moments? Or are you so impressed with authority that you give respect and credence to all that claim it? Do you read everything you're supposed to read? Do you think every thing you're supposed to think? Buy what you're told to want? Get out of your apartment. Meet a member of the opposite sex. Stop the excessive shopping and masturbation.Quit your job. Start a fight. Prove you're alive. If you don't claim your humanity you will become a statistic. You have been warned - Onur 




-- 
Warning: If you are reading this then this warning is for you. Every word you read of this useless fine print is another second off your life. Don't you have other things to do? Is your life so empty that you honestly can't think of a better way to spend these moments? Or are you so impressed with authority that you give respect and credence to all that claim it? Do you read everything you're supposed to read? Do you think every thing you're supposed to think? Buy what you're told to want? Get out of your apartment. Meet a member of the opposite sex. Stop the excessive shopping and masturbation.Quit your job. Start a fight. Prove you're alive. If you don't claim your humanity you will become a statistic. You have been warned - Onur 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070829/53451ca3/attachment.html 
-------------- next part --------------
An embedded message was scrubbed...
From: "Igor Zelmanovich" <igorz at mainsoft.com>
Subject: Re: [Mono-dev] Controls inside an Ajax UpdatePanel
Date: Mon, 20 Aug 2007 01:24:45 -0700
Size: 6458
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070829/53451ca3/attachment.mht 


More information about the Mono-devel-list mailing list