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

From: [email protected] 
[mailto:[email protected]] 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>
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to