Solved

WebUserControl is ambiguous in asp.net vb

Posted on 2009-07-12
1
910 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now