[IronPython] cannot access protected member GaugeContainer1 without a python subclass of default_aspx

Dino Viehland dinov at microsoft.com
Thu Oct 21 19:32:36 CEST 2010


What this error means is that you're attempting to access a member which is declared as protected on something which is not a Python subclass.  This would be the same as:

public class Foo {
                protected void Bar() {
                }
}

public class Bar {
                public Bar() {
                                new Foo().Bar();
                }
}

Here C# gives you the error: "error CS0122: 'Foo.Bar()' is inaccessible due to its protection level"

In this case I think what's happening is a member is being generated in a class for the GaugeControl1 - you need to somehow make that member public.  I don't actually know how to do that but hopefully you can do something like 'Accessibility="public"' onto the DGWC:GaugeContainer tag.


From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Kurt A. Richardson
Sent: Wednesday, October 20, 2010 12:07 PM
To: users at lists.ironpython.com
Subject: Re: [IronPython] cannot access protected member GaugeContainer1 without a python subclass of default_aspx

Some progress...

It seems that the EnableSessionState="true" in the page declaration is causing the problem.  If I remove it the page compiles and views OK.

Any ideas why?

Thanks, Kurt

On 10/20/2010 11:54 AM, Kurt A. Richardson wrote:
PPS As I went through commenting-out calls to page controls I found that I can't evenset-up the DropDownList I have on the page, let alone the Dundas ones.

One thing I noticed is that the page declaration:

<%@ Page Language="IronPython" Theme="MSH" EnableSessionState="true" CodeFile="Default.aspx.py" %>

has a warning associated with the CodeFile:

The language of the file referenced by the 'CodeFile' attribute does not match the language specified by the 'Language' attribute in the current file.

On 10/20/2010 11:47 AM, Kurt A. Richardson wrote:
PS I'm using IPY 2.7 Alpha 1 with VS2010 .NET 4.0

On 10/20/2010 11:45 AM, Kurt A. Richardson wrote:
Hi List

I have a (relatively) simple webpage that enables me to display some basic data from my TED5000 energy monitor, as well as switch a fan on and off in my offer utilizing an XBee network.  I'm sure everything worked just fine for months and now suddenly the project will not compile.

The Default.aspx webpage includes a Dundas GaugeContainer component instantiated as:

<DGWC:GaugeContainer ID="GaugeContainer1" runat="server">...</DGWC:GaugeContainer>

The Dundas Gauge assembly is referenced correctly:

<%@ Register Assembly="DundasWebGauge" Namespace="Dundas.Gauges.WebControl" TagPrefix="DGWC" %>

The CodeFile (Default.aspx.py) contains some simple functions, but the one that throws an error is part of the Page_Load function:

def Page_Load(sender,e):
    if not IsPostBack:
        gauge = GaugeContainer1
        gauge.Callback += GaugeContainer1_Callback

The third line (gauge = GaugeContainer1) results in the following parse error:

Parser Error Message: cannot access protected member GaugeContainer1 without a python subclass of default_aspx

Any ideas what is causing this error?

Many thanks in advance for any assistance you can offer.

Kind regards, Kurt





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20101021/70f8e11a/attachment.html>


More information about the Ironpython-users mailing list