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

Dody Gunawinata empirebuilder at gmail.com
Tue May 26 23:35:29 PDT 2009

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 :

        public StateBag ViewState
            get { return base.ViewState; }

and then modify your web.config

    <pages compilationMode="Auto"

               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.

Other than that, everything else looks dandy. Enjoy.

Dody Gunawinata
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20090527/0faebff4/attachment.htm>

More information about the Users mailing list