本文介绍了用户控件无法理解事件(编译器失败,但Visual Studio通过)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个aspx页面(default.aspx),它通过register tagprefix语法加载两个用户控件。 1)1.ascx 2)2.ascx 3)ctrlc.aspx 2.ascx将一个事件定义为Public testwrite作为EventHandler,并在其中一个方法中(如果testwrite不是什么)
testwrite(me,e)现在在1.ascx中,当我尝试执行以下操作时,编译器抛出错误:AddHandler othercontrol.testwrite,AddressOf ctrlc.eventhandler虽然visual studio理解语法,但是有一个编译器错误后悔没有这样的
事件!注意:这可能对我的其他线程(http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/c065883c-e2c0-4002-8c19-b74f08e2e7d0)有弱引用但不确定因此播种单个线程。如果您觉得所描述的问题是
一个,管理员/主持人可以合并主题吗?

解决方案

I have an aspx page (default.aspx) which loads two user controls through register tagprefix syntax. 1) 1.ascx 2) 2.ascx 3) ctrlc.aspx 2.ascx defines an event as Public testwrite as EventHandler and in one of its methods it does (if testwrite isnot nothing) testwrite (me,e) Now in 1.ascx when I am trying to do the following, compiler throws an error: AddHandler othercontrol.testwrite, AddressOf ctrlc.eventhandler Whilst visual studio understands the syntax, there is a compiler error regretting there is no such event! NOTE: This may have a weak reference to my other thread (http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/c065883c-e2c0-4002-8c19-b74f08e2e7d0) but not sure and hence seeding an individual thread. If you feel the problems described are one and the same can an admin/moderator merge the topics please?

解决方案


这篇关于用户控件无法理解事件(编译器失败,但Visual Studio通过)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-25 07:39