无法访问受保护的成员...没有 python 子类

发布于 2024-09-17 10:08:34 字数 361 浏览 1 评论 0原文

bt_volver 是一个 System.Web.UI.webcontrols.button,它只是一个在 2.0 中可以正常工作的代码

IronPython 2.6.911.0 in ASP.NET webforms 
Visual Studio 2008 Professional 9.0.30729.1 SP

 cannot access protected member
 bt_volver without a python subclass of
 abmlocalidades_aspx

  Error de código fuente: 

  Línea 7:          else: bt_volver.Visible = 0

bt_volver is a System.Web.UI.webcontrols.button and it's just a code it used to work fine in 2.0

IronPython 2.6.911.0 in ASP.NET webforms 
Visual Studio 2008 Professional 9.0.30729.1 SP

 cannot access protected member
 bt_volver without a python subclass of
 abmlocalidades_aspx

  Error de código fuente: 

  Línea 7:          else: bt_volver.Visible = 0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

转瞬即逝 2024-09-24 10:08:34

这是已知的更改 - 您应该使用反射来访问受保护的成员和私有成员。

something.GetType().GetField("bt_volver", BindingFlags.Instance | BindingFlags.NonPublic)

或者您可以尝试 ipy.exe -X:PrivateBinding 开关。

This is known change - you should use reflection to access protected and private members.

something.GetType().GetField("bt_volver", BindingFlags.Instance | BindingFlags.NonPublic)

Or you can try ipy.exe -X:PrivateBinding switch.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文