[IronPython] Tips for IronPython for ASP.Net (IronPython 2.6 Beta 1)

Jimmy Schementi Jimmy.Schementi at microsoft.com
Wed May 27 09:13:18 CEST 2009


Thanks for the feedback Dody. I'll take a look and see if there are quick fixes to these.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dody Gunawinata
Sent: Tuesday, May 26, 2009 11:35 PM
To: Discussion of IronPython
Subject: [IronPython] Tips for IronPython for ASP.Net (IronPython 2.6 Beta 1)

1. ViewState property is not available in UserControl (this is a bug) but this is easily rectified. Just create an assembly that inherits from Microsoft.Web.Scripting.UI.ScriptUserControl

            public class ScriptUserControlBase : Microsoft.Web.Scripting.UI.ScriptUserControl
            {

        public StateBag ViewState
        {
            get { return base.ViewState; }
        }
     }

and then modify your web.config

    <pages compilationMode="Auto"
            pageParserFilterType="Microsoft.Web.Scripting.UI.NoCompileCodePageParserFilter"
               pageBaseType="XXX"
               userControlBaseType="YYYY" >

and replace the userControlBaseType from the standard to ScriptUserControlBase. It will then work normally.

ViewState is available up in the hierarchy in System.Web.UI.Control, but since it is protected, it is not available for the code behind code. This brings us to the second tip.


2. The page behind can only access public methods/members from the parent class container. This is a change of behavior from the previous version of IP for  asp.net<http://asp.net>.

Other than that, everything else looks dandy. Enjoy.


Dody Gunawinata
--
nomadlife.org<http://nomadlife.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090527/6531bebf/attachment.html>


More information about the Ironpython-users mailing list