用户控件无法理解事件(编译器失败,但Visual Studio通过) [英] Events are not understood by user control (Compiler Fails But Visual Studio Passes)

查看:66
本文介绍了用户控件无法理解事件(编译器失败,但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)有弱引用但不确定因此播种单个线程。如果您觉得所描述的问题是
一个,管理员/主持人可以合并主题吗?

解决方案

Deepak,


如果是关于控件,那么就像WPF,Windows Forms和Asp.Net论坛那样有论坛。 


这不是尽管可以阅读严格,如何使用VB代码控件当然是一个VB问题。 


然而,你的问题完全围绕着ASPX控件本身以及如何webbrowser(chrome,IE)随之起作用。


http://forums.asp达网络


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?

解决方案

Deepak,

If it is about controls, then there are forums for that like the WPF, the Windows Forms and the Asp.Net forum. 

That is not as strict as it can be read, how to use a control with VB code can be of course a VB question. 

However, your question is completely around the ASPX control itself and how the webbrowser (chrome, IE) acts with it.

http://forums.asp.net


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆