[Mono-dev] System.Web.Extension

Onur Gumus emperon at gmail.com
Tue Aug 28 13:59:47 EDT 2007


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.Objectsender,
System.EventArgs e) [0x00000]   at test55.xx.Button1_Click
(System.Objectsender,
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.dllimplements 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/20070828/bf93a713/attachment.html 


More information about the Mono-devel-list mailing list