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.

Other than that, everything else looks dandy. Enjoy.


Dody Gunawinata
-- 
nomadlife.org
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to