Change the tag prefix of a custom control

S

shapper

Hello,

How can I change the tag prefix of a custom control.
My Asp.Net 2.0 custom control tag prefix is cc1.

Thanks,
Miguel
 
T

Teemu Keiski

Hi,

you can specify the prefix with @register directive on top of the page

< %@Register TagPrefix="myprefix" Namespace="System.MyControls"
Assembly="System.MyControls" % >

in ASP.NET 2.0, if you omit the Assembly attribute, control is looked from
App_Code
 
S

shapper

I think I am not understanding.
I created a few custom controls and I compiled my project to a dll
library.
When I drag one of my custom controls from the toolbox to an Aspx page
I get:
<cc1:MyCustomControl> ....

What I want is to change cc1 to something else.
I supose I need to do this inside my library code before I compile it.
I just don't know where.
I have a VB file for each custom control I create.

Thanks,
Miguel
 
T

Teemu Keiski

The prefix is specified always on top of the aspx page on @Register
directive, since the control needs to be registered on the page. Despite
that its a custom control (or user control whatever, same thing applies),
and that's the prefix you use omn the page. cc1 is the default.

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
http://blogs.aspadvice.com/joteke
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top