Can't get TagPrefix to work for custom Web control

M

Michael Skelton

Hi

I've created a new custom Web control. I have tried to customize the assembly attribute TagPrefix . However, each time I drag my custom control onto a form, it's TagPrefix is still "cc1". What am I missing here

My control is nested within two namespaces: for example, OuterNamespace and InnerNamespace. Taking that into account, the AssemblyInfo.cs of my custom control's solution contains the following additional lines

..
using System.Web.UI
..
[assembly: TagPrefix("OuterNamespace.InnerNamespace", "mas")
..

I build my custom control, add it to the VS Toolbox, and test it by dropping it on a form. Alas, instead of being prefixed by "mas", the control is still prefixed by "cc1". Any advice on this one

Thanks in advance
-Michael
 
J

JohnnyV

Hi,

Your approach is perfect. I have done the same thing with my custom
control and I get the custom prefix. My doubt is on some typo on your
namespace. Try changing the namespace of your custom control to something
different and copy and paste the same onto the attribute and see what
happens, to rule out this possibility.

Regards







Michael Skelton said:
Hi,

I've created a new custom Web control. I have tried to customize the
assembly attribute TagPrefix . However, each time I drag my custom control
onto a form, it's TagPrefix is still "cc1". What am I missing here?
My control is nested within two namespaces: for example, OuterNamespace
and InnerNamespace. Taking that into account, the AssemblyInfo.cs of my
custom control's solution contains the following additional lines:
...
using System.Web.UI;
...
[assembly: TagPrefix("OuterNamespace.InnerNamespace", "mas")]
...

I build my custom control, add it to the VS Toolbox, and test it by
dropping it on a form. Alas, instead of being prefixed by "mas", the control
is still prefixed by "cc1". Any advice on this one?
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top