Solved

WebUserControl is ambiguous in asp.net vb

Posted on 2009-07-12
1
919 Views
Last Modified: 2013-11-26
I am building an asp.net vb website, and having troubles with webusercontrols.  I have several user controls: menu_top1.ascx & menu_top2.ascx & menu_aboutus.ascx.  I have several pages created that reference these controls.  I can view the pages, and look at them one at a time, however, when I publish the site through Visual Studio 2008, I begin getting errors "aa_includes_WebUserControl' is ambiguous" at each line where I reference the  user control I want to use.  I have included two web pages where I have used the webusercontrols and the .ascx files.  Thanks for the help.
page: template_home.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="template_home.aspx.vb" Inherits="aa_templates_Default" %>
<%@ Register src="../aa_includes/menu_top1.ascx" tagname="menu_top1" tagprefix="uc1" %> 
<%@ Register src="../aa_includes/menu_top2.ascx" tagname="menu_top2" tagprefix="uc1" %> 
<%@ Register src="../aa_includes/menu_aboutus.ascx" tagname="menu_aboutus" tagprefix="uc1" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <style type="text/css"></style>
    <link href="../main_site.css" rel="stylesheet" type="text/css" />    
</head>
<body>
    <asp:Table ID="tb_Body" Width="100%" Height="100%" BackColor="White" runat="server">
        <asp:TableRow>
            <asp:TableCell HorizontalAlign="Center" VerticalAlign="Top">
            <asp:Table ID="tb_Body2" width="100%" CellPadding="0" CellSpacing="0" runat="server">
                <asp:TableRow CssClass="TopRow1">
                    <asp:TableCell>
                        <asp:Table ID="tb_Top_Menu" width="800" HorizontalAlign="Center" runat="server">
                            <asp:TableRow HorizontalAlign="Right">
                                <asp:TableCell>
                                <uc1:menu_top1 ID="WebUserControl1" runat="server" />
                                </asp:TableCell>
                            </asp:TableRow>                            
                        </asp:Table>                                                                                                        
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow CssClass="TopRow2">                    
                    <asp:TableCell>
                        <asp:Table ID="Table1" width="800" HorizontalAlign="Center" runat="server">
                            <asp:TableRow  CssClass="TopRow2" HorizontalAlign="Right">
                                <asp:TableCell>
                                <uc1:menu_top2 ID="WebUserControl2" runat="server" />
                                </asp:TableCell>
                            </asp:TableRow>                            
                        </asp:Table>                                                                                                        
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow CssClass="SpacerRow">
                    <asp:TableCell></asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>                    
                    <asp:TableCell>
                        <asp:Table ID="Table_Body" width="800" Height="300" HorizontalAlign="Center" runat="server">
                            <asp:TableRow HorizontalAlign="Right" VerticalAlign="Top">
                                <asp:TableCell>
                                    <asp:Table ID="Table2" runat="server">
                                        <asp:TableRow VerticalAlign="Top">
                                            <asp:TableCell Width="200">
                                            <uc1:menu_aboutus ID="WebUserControl3" runat="server" />
                                            </asp:TableCell>
                                            <asp:TableCell Width="20"></asp:TableCell>
                                            <asp:TableCell Width="580" BackColor="LightGray"></asp:TableCell>                                                                                
                                        </asp:TableRow>                                                                        
                                    </asp:Table>                                                                                                                                                            
                                </asp:TableCell>
                            </asp:TableRow>                            
                        </asp:Table>                                                                                                                                                                    
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow CssClass="SpacerRow">
                    <asp:TableCell>&nbsp;</asp:TableCell>
                </asp:TableRow>
                <asp:TableRow CssClass="BottomRow">
                    <asp:TableCell CssClass="BottomMenu">Copyright 2009 © Livingway Pentecostal Church 1617 
                    E. McNeese Street, Lake Charles, LA 70607 (337) 478-2412</asp:TableCell>
                </asp:TableRow>                       
            </asp:Table>                        
            </asp:TableCell>    
        </asp:TableRow>
    </asp:Table>
</body>
</html>
 
page: template_page.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="template_page.aspx.vb" Inherits="_Default" %>
<%@ Register src="../aa_includes/menu_top1.ascx" tagname="menu_top1" tagprefix="uc1" %> 
<%@ Register src="../aa_includes/menu_top2.ascx" tagname="menu_top2" tagprefix="uc1" %> 
<%@ Register src="../aa_includes/menu_aboutus.ascx" tagname="menu_aboutus" tagprefix="uc1" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <style type="text/css"></style>
    <link href="../main_site.css" rel="stylesheet" type="text/css" />    
</head>
<body>
    <asp:Table ID="tb_Body" Width="100%" Height="100%" BackColor="White" runat="server">
        <asp:TableRow>
            <asp:TableCell HorizontalAlign="Center" VerticalAlign="Top">
            <asp:Table ID="tb_Body2" width="100%" CellPadding="0" CellSpacing="0" runat="server">
                <asp:TableRow CssClass="TopRow1">                    
                    <asp:TableCell>
                        <asp:Table ID="tb_Top_Menu" width="800" HorizontalAlign="Center" runat="server">
                            <asp:TableRow HorizontalAlign="Right">
                                <asp:TableCell>
                                <uc1:menu_top1 ID="WebUserControl1" runat="server" />
                                </asp:TableCell>
                            </asp:TableRow>                            
                        </asp:Table>                                                                                                        
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow CssClass="TopRow2">                    
                    <asp:TableCell>
                        <asp:Table ID="Table1" width="800" HorizontalAlign="Center" runat="server">
                            <asp:TableRow  CssClass="TopRow2" HorizontalAlign="Right">
                                <asp:TableCell>
                                <uc1:menu_top2 ID="WebUserControl2" runat="server" />
                                </asp:TableCell>
                            </asp:TableRow>                            
                        </asp:Table>                                                                                                        
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow CssClass="SpacerRow">
                    <asp:TableCell></asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>                    
                    <asp:TableCell>
                        <asp:Table ID="Table2" width="800" Height="400" HorizontalAlign="Center" runat="server">
                            <asp:TableRow HorizontalAlign="Right">
                                <asp:TableCell BackColor="LightGray">                                
                                </asp:TableCell>
                            </asp:TableRow>                            
                        </asp:Table>                                                                                                                                                                    
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow CssClass="SpacerRow">
                    <asp:TableCell>&nbsp;</asp:TableCell>
                </asp:TableRow>
                <asp:TableRow>                    
                    <asp:TableCell>
                        <asp:Table ID="Table3" width="800" HorizontalAlign="Center" runat="server">
                            <asp:TableRow HorizontalAlign="Right">
                                <asp:TableCell>
                                    <asp:Table ID="Table4" height="175" runat="server">
                                        <asp:TableFooterRow>
                                            <asp:TableCell Width="252" BackColor="LightGray" ></asp:TableCell>
                                            <asp:TableCell Width="22"></asp:TableCell>
                                            <asp:TableCell Width="252" BackColor="LightGray"></asp:TableCell>
                                            <asp:TableCell Width="22"></asp:TableCell>
                                            <asp:TableCell Width="252" BackColor="LightGray"></asp:TableCell>                                        
                                        </asp:TableFooterRow>                                                                            
                                    </asp:Table>                                                                                                
                                </asp:TableCell>
                            </asp:TableRow>                            
                        </asp:Table>                                                                                                                                                                                                            
                    </asp:TableCell>
                </asp:TableRow>
                <asp:TableRow CssClass="SpacerRow">
                    <asp:TableCell></asp:TableCell>
                </asp:TableRow>
                <asp:TableRow CssClass="BottomRow">
                    <asp:TableCell CssClass="BottomMenu">Copyright 2009 © Livingway Pentecostal Church 1617 
                    E. McNeese Street, Lake Charles, LA 70607 (337) 478-2412</asp:TableCell>
                </asp:TableRow>                       
            </asp:Table>                        
            </asp:TableCell>    
        </asp:TableRow>
    </asp:Table>
</body>
</html>
 
menu_top1.ascx
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="menu_top1.ascx.vb" Inherits="aa_includes_menu_top1" %>
<link href="../main_site.css" rel="stylesheet" type="text/css" />
<asp:table ID="TopRowMenu" HorizontalAlign="Right" runat="server">
    <asp:TableRow HorizontalAlign="Right">
        <asp:TableCell CssClass="TopRowMenu"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='aa_aboutus/servicetimes.aspx'">Service Times</a></asp:TableCell>
        <asp:TableCell CssClass="TopRowMenu">&nbsp;|&nbsp;</asp:TableCell>
        <asp:TableCell CssClass="TopRowMenu"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='aa_aboutus/directions.aspx'">Direction</a></asp:TableCell>
        <asp:TableCell CssClass="TopRowMenu">&nbsp;|&nbsp;</asp:TableCell>
        <asp:TableCell CssClass="TopRowMenu"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='aa_secure/announcements.aspx'">Announcements</a></asp:TableCell>
        <asp:TableCell CssClass="TopRowMenu">&nbsp;|&nbsp;</asp:TableCell>
        <asp:TableCell CssClass="TopRowMenu"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='aa_aboutus/contactus.aspx'">Contact Us</a></asp:TableCell>
        <asp:TableCell CssClass="TopRowMenu">&nbsp;|&nbsp;</asp:TableCell>
        <asp:TableCell CssClass="TopRowMenu"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='quicklinks.aspx'">Quick Links</a></asp:TableCell>
        <asp:TableCell CssClass="TopRowMenu">&nbsp;|&nbsp;</asp:TableCell>
        <asp:TableCell CssClass="TopRowMenu"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='aa_webcasts/podcasts.aspx'">Podcasts</a></asp:TableCell>
    </asp:TableRow>                            
</asp:table>
 
menu_top2.ascx
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="menu_top2.ascx.vb" Inherits="aa_includes_WebUserControl" %>
<link href="../main_site.css" rel="stylesheet" type="text/css" />
<asp:table HorizontalAlign="Right" ID="TopRowMenu2" runat="server">
    <asp:TableRow HorizontalAlign="Right">
		<asp:TableCell width="200">
			<asp:table ID="Table10" runat="server">
				<asp:TableRow>
					<asp:TableCell><asp:Image ID="Image1" runat="server" ImageUrl="~/aa_images/top_menu1_logo.gif" /></asp:TableCell>				
				</asp:TableRow>                            
			</asp:table>
		</asp:TableCell>									
		<asp:TableCell width="666">
			<asp:table ID="Table_10" runat="server">
				<asp:TableRow>
					<asp:TableCell CssClass="TopRowMenu2"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='index.aspx'">Home</a></asp:TableCell>
					<asp:TableCell CssClass="TopRowMenu2Seperators">&nbsp;|&nbsp;</asp:TableCell>
					<asp:TableCell CssClass="TopRowMenu2"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='aa_aboutus/aboutus.aspx'">About Us</a></asp:TableCell>
					<asp:TableCell CssClass="TopRowMenu2Seperators">&nbsp;|&nbsp;</asp:TableCell>
					<asp:TableCell CssClass="TopRowMenu2"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='aa_secure/login.aspx'">Login</a></asp:TableCell>
					<asp:TableCell CssClass="TopRowMenu2Seperators">&nbsp;|&nbsp;</asp:TableCell>
					<asp:TableCell CssClass="TopRowMenu2"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='aa_ministries/connect.aspx'">Connect</a></asp:TableCell>
					<asp:TableCell CssClass="TopRowMenu2Seperators">&nbsp;|&nbsp;</asp:TableCell>
					<asp:TableCell CssClass="TopRowMenu2"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='aa_webcasts/webcasts.aspx'">Live WebCast</a></asp:TableCell>																				
				</asp:TableRow>                            
			</asp:table>
		</asp:TableCell>
    </asp:TableRow>                            
</asp:table>
 
 
menu_aboutus.ascx
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="menu_aboutus.ascx.vb" Inherits="aa_includes_WebUserControl" %>
<link href="../main_site.css" rel="stylesheet" type="text/css" />
<asp:table HorizontalAlign="Left" ID="Menu_Left_AboutUs" runat="server">
    <asp:TableRow CssClass="LeftMenu">
		<asp:TableCell CssClass="LeftMenuHeader"></asp:TableCell>            
	</asp:TableRow>
	<asp:TableRow CssClass="LeftMenu">		
		<asp:TableCell CssClass="LeftMenu"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='http://google.com'">About Us</a></asp:TableCell>
    </asp:TableRow>
	<asp:TableRow CssClass="LeftMenu">		
		<asp:TableCell CssClass="LeftMenu"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='http://google.com'">About Livingway</a></asp:TableCell>
	</asp:TableRow>
	<asp:TableRow CssClass="LeftMenu">		
		<asp:TableCell CssClass="LeftMenu"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='http://google.com'">Our Leaders</a></asp:TableCell>
	</asp:TableRow>
	<asp:TableRow CssClass="LeftMenu">		
		<asp:TableCell CssClass="LeftMenu"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='http://google.com'">What We Believe</a></asp:TableCell>
	</asp:TableRow>
	<asp:TableRow CssClass="LeftMenu">		
		<asp:TableCell CssClass="LeftMenu"><a onmouseover="CssClass='TopRowMenu'" onmouseout="CssClass='TopRowMenu'" onclick="location.href='http://google.com'">Directions</a></asp:TableCell>
	</asp:TableRow>
    <asp:TableRow CssClass="LeftMenu">		
        <asp:TableCell  CssClass="LeftMenuHeader"></asp:TableCell>
	</asp:TableRow>                                    
</asp:table>

Open in new window

0
Comment
Question by:OB1Canobie
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 15

Accepted Solution

by:
NazoUK earned 500 total points
ID: 24835967
Your menu_top2.ascx and menu_aboutus.ascx both have the same classname (aa_includes_WebUserControl) they must be different.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question