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

  • Thread starter Thread starter Showjumper
  • Start date Start date
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?
 
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.
 
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. .
 
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.
 
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
 
Back
Top