two web user controls with same name in different namespace gives error

D

Don

I have 2 web user controls (.ascx) with the same name that are in in
different namespaces.
When I try to put both controls on the same page I get the following
runtime error:
BC30560: 'searchCriteria_ascx' is ambiguous in the namespace 'ASP'.

The register tag on the page shows that both controls have the same
tagName but different tagPrefixes.

-------------
Detailed Info:
My application has two types of employees, permanent and temporary. My
control allows the user to pick the search criteria for an employee so
I have a class called searchCriteria in the namespace
Employee.Permanent and another class called searchCriteria in the
namespace Employee.Temporary. They both implement a common Interface
put also have differnces in how they work.

This is the declaration of my code behind class:
Namespace Employee.Permanent
Public Class searchCriteria
Inherits System.Web.UI.UserControl
Implements Interfaces.searchCriteria
...

This is the control line in the ascx file:
<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="searchCriteria.ascx.vb"
Inherits="HumanResourceManager.Employee.Permanent.searchCriteria"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

These are the register tags on the page:
<%@ Register TagPrefix="uc2" TagName="searchCriteria"
Src="../../Employee/Permanent/searchCriteria.ascx" %>

<%@ Register TagPrefix="uc1" TagName="searchCriteria"
Src="../../Employee/Temporary/searchCriteria.ascx" %>


Thanks,
Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top