再次编译错误 [英] compilation error again

查看:78
本文介绍了再次编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译器错误消息:BC30260图像4已在此类中声明为受保护的Dim WithEvents Image4 As System.Web.UI.WebControls.Image



I只完成了一个复制项目并将文件移动到服务器。在我的本地主机上一切正常没有错误。我没有故意多次声明控件,只是从工具箱中获取控制权,在页面上控制工作然后将文件上传到服务器。我必须在#Region中的整个aspx.vb页面上删除与每个webcontrol图像相关的代码Web窗体设计器生成的代码只是为了让页面加载而没有错误,那么所有按钮都能正常工作并且页面没有问题。



公共类索引

继承System.Web.UI.Page



#RegionWeb窗体设计器生成的代码



'Web窗体设计器需要此调用。

< system.diagnostics .debuggerstepthrough()> Private Sub InitializeComponent()



End Sub

受保护WithEvents Image4 As System.Web.UI.WebControls.Image

Protected WithEvents Image6 As System.Web.UI.WebControls.Image

Protected WithEvents Image5 As System.Web.UI.WebControls.Image

Protected WithEvents lblfcc As System。 Web.UI.WebControls.Label

Protected WithEvents Label4 As System.Web.UI.WebControls.Label

Protected WithEvents Label3 As System.Web.UI.WebControls.Label

受保护的事件HyperLink7 As System.Web.UI.WebControls.HyperLink

受保护的事件HyperLink6 As System.Web.UI.WebControls.HyperLink

受保护WithEvents HyperLink5 As System.Web.UI.WebControls.HyperLink

Protected WithEvents HyperLink3 As System.Web.UI.WebControls.HyperLink

Protected WithEvents HyperLink2 As System.Web.UI .WebControls.HyperLink

受保护WithEven ts HyperLink1 As System.Web.UI.WebControls.HyperLink

受保护的事件HyperLink8 As System.Web.UI.WebControls.HyperLink

Complier error message: BC30260 Image 4 is already declared as 'Protected Dim WithEvents Image4 As System.Web.UI.WebControls.Image' in this class

I have only done a copy project and moved files to server. Everything worked fine on my local host no errors. I have not purposely declared control more than once, only took control from toolbox, got control working on page then uploaded file to server.I have to rem out the code related to every webcontrol image on the entire aspx.vb page within the #Region " Web Form Designer Generated Code "just to get the page to load with no errors, then all buttons work and no problem with page.

Public Class Index
Inherits System.Web.UI.Page

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()

End Sub
Protected WithEvents Image4 As System.Web.UI.WebControls.Image
Protected WithEvents Image6 As System.Web.UI.WebControls.Image
Protected WithEvents Image5 As System.Web.UI.WebControls.Image
Protected WithEvents lblfcc As System.Web.UI.WebControls.Label
Protected WithEvents Label4 As System.Web.UI.WebControls.Label
Protected WithEvents Label3 As System.Web.UI.WebControls.Label
Protected WithEvents HyperLink7 As System.Web.UI.WebControls.HyperLink
Protected WithEvents HyperLink6 As System.Web.UI.WebControls.HyperLink
Protected WithEvents HyperLink5 As System.Web.UI.WebControls.HyperLink
Protected WithEvents HyperLink3 As System.Web.UI.WebControls.HyperLink
Protected WithEvents HyperLink2 As System.Web.UI.WebControls.HyperLink
Protected WithEvents HyperLink1 As System.Web.UI.WebControls.HyperLink
Protected WithEvents HyperLink8 As System.Web.UI.WebControls.HyperLink

推荐答案

在解决方案中搜索 Image4 ,找到声明它的所有地方。听起来有两个在 Index 类的上下文中声明。



删除你没有的那个需要,你应该没事。



希望这会有所帮助,

Fredrik
Do a search for Image4 in you solution to find all the places where it's been declared. It sounds like there's two declared in the context of the Index class.

Delete the one you don't need and you should be fine.

Hope this helps,
Fredrik


这篇关于再次编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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