Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple web controls using same prefix 1

Status
Not open for further replies.

xpblueScreenOfDeath

Programmer
Sep 1, 2004
87
I have written a couple web controls, but it generates a error if I give it the same prefix; otherwise it runs fine.

For example, I have a login and tab control that uses the same namespace such as xx.myControls. It would generate the the following error message: Could not load type xx.myControls.Login from assembly TabCtrl, Version=1.0.1849.1024, Culture=neutral, PublicKeyToken=null

I register the assemblies as such:
<%@ Register TagPrefix="cc" Namespace="xx.myControls" Assembly="Login"%>
<%@ Register TagPrefix="cc" Namespace="xx.myControls" Assembly="TabCtrl"%>

If I give them different prefixes then the webpage runs fine, such as:
<%@ Register TagPrefix="cc" Namespace="xx.myControls" Assembly="Login"%>
<%@ Register TagPrefix="dd" Namespace="xx.myControls" Assembly="TabCtrl"%>

Do I have to compile all my controls into one assembly to use the same prefix or am I doing something wrong?
 
That is correct. If you want to use the same prefix you need to be using the same dll.

The register command maps a prefix to the specified namespace in the specified assembly.

In fact you will need different prefixes for different namespaces in the same assembly.

This is needed otherwise the parser doesn't know where to go to get the control that you are trying to display.

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top