Why doesnt custom TagPrefix work in controls made w/ VBNET?

S

Showjumper

I cannot get the custom Tag Prefix to work in controls made w/ VBNET. Why???
It works just fine in controls made w/ c#. Is vbnet just buggy?
 
M

MikeB

Showjumper said:

You might want to take the trouble to post a simple example of what you're
doing. There's not much to go on in your question.

Even if you had posted an example, it's a bit much to expect an answer in
less than 2 hours.
 
S

Showjumper

Yeah i know its just been driving me nuts. I am working on a control wrtten
in VBNET. I add this to the assembly info file:
<Assembly: TagPrefix("RiderDesign.Text", "RD")>

I build the project and add the control to the toolbox, drop it onto the
page and i still end up w/ cc1 as the tag prefix. Now in c# i do the same
thing and the tag prefix work right from the start - i have rd as the
prefix. .
 
M

MikeB

Showjumper said:
Yeah i know its just been driving me nuts. I am working on a control wrtten
in VBNET. I add this to the assembly info file:
<Assembly: TagPrefix("RiderDesign.Text", "RD")>

I build the project and add the control to the toolbox, drop it onto the
page and i still end up w/ cc1 as the tag prefix. Now in c# i do the same
thing and the tag prefix work right from the start - i have rd as the
prefix. .

I'm just guessing (as I don't have time to test this), but when you set up a
VB project in VS.NET you get a 'root namespace' for the project that all of
your declared namespaces are underneath. The root namespace name defaults
to the name of the VB project. Check the properties page for the VB project
to see what I'm talking about.

So, in the VB project that's building the control, the namespace the control
is in is probably not "RiderDesign.Text", it's probably
"YourVBProjectName.RiderDesign.Text". The page designer doesn't see a
matching TagPrefix attribute, and gives the default prefix of "cc1".

I did a (very) minor rant on this default root namespace thing a couple of
weeks ago. I'll bet you'll want to do the same if this turns out to be your
problem.
 
S

Showjumper

Thats it. All this grief because VB mangles the namespace.
MikeB said:
Showjumper said:
Yeah i know its just been driving me nuts. I am working on a control wrtten
in VBNET. I add this to the assembly info file:
<Assembly: TagPrefix("RiderDesign.Text", "RD")>

I build the project and add the control to the toolbox, drop it onto the
page and i still end up w/ cc1 as the tag prefix. Now in c# i do the same
thing and the tag prefix work right from the start - i have rd as the
prefix. .

I'm just guessing (as I don't have time to test this), but when you set up a
VB project in VS.NET you get a 'root namespace' for the project that all of
your declared namespaces are underneath. The root namespace name defaults
to the name of the VB project. Check the properties page for the VB project
to see what I'm talking about.

So, in the VB project that's building the control, the namespace the control
is in is probably not "RiderDesign.Text", it's probably
"YourVBProjectName.RiderDesign.Text". The page designer doesn't see a
matching TagPrefix attribute, and gives the default prefix of "cc1".

I did a (very) minor rant on this default root namespace thing a couple of
weeks ago. I'll bet you'll want to do the same if this turns out to be your
 

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,009
Latest member
GidgetGamb

Latest Threads

Top