Solved

WebUserControl is ambiguous in asp.net vb

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

760 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

19 Experts available now in Live!

Get 1:1 Help Now