Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Posted
Updated 8-Dec-13 8:57am
v2
Comments
Sergey Alexandrovich Kryukov 8-Dec-13 14:11pm    
Are you serious? You declare something more than once to some context thus creating the ambiguity, and don't show us this context. Could you use some elementary common sense when asking question. Either resolve the problem by yourself, or make a relevant code sample.
—SA

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900