Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Change the tag prefix of a custom control

Reply
Thread Tools

Change the tag prefix of a custom control

 
 
shapper
Guest
Posts: n/a
 
      10-10-2006
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

 
Reply With Quote
 
 
 
 
Teemu Keiski
Guest
Posts: n/a
 
      10-10-2006
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

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

"shapper" <> wrote in message
news: ups.com...
> 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
>



 
Reply With Quote
 
 
 
 
shapper
Guest
Posts: n/a
 
      10-11-2006
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

Teemu Keiski wrote:
> 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
>
> --
> Teemu Keiski
> ASP.NET MVP, AspInsider
> Finland, EU
> http://blogs.aspadvice.com/joteke
>
> "shapper" <> wrote in message
> news: ups.com...
> > 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
> >


 
Reply With Quote
 
Teemu Keiski
Guest
Posts: n/a
 
      10-13-2006
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



"shapper" <> wrote in message
news: ups.com...
>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
>
> Teemu Keiski wrote:
>> 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
>>
>> --
>> Teemu Keiski
>> ASP.NET MVP, AspInsider
>> Finland, EU
>> http://blogs.aspadvice.com/joteke
>>
>> "shapper" <> wrote in message
>> news: ups.com...
>> > 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
>> >

>



 
Reply With Quote
 
gerry
Guest
Posts: n/a
 
      10-16-2006
look at the attribute [assembly:TagPrefix()]

http://msdn2.microsoft.com/en-us/library/ms366537.aspx



"Teemu Keiski" <> wrote in message
news:%...
> 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
>
>
>
> "shapper" <> wrote in message
> news: ups.com...
> >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
> >
> > Teemu Keiski wrote:
> >> 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
> >>
> >> --
> >> Teemu Keiski
> >> ASP.NET MVP, AspInsider
> >> Finland, EU
> >> http://blogs.aspadvice.com/joteke
> >>
> >> "shapper" <> wrote in message
> >> news: ups.com...
> >> > 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
> >> >

> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
install python to custom prefix with custom library directories =?utf-8?Q?Poor=20Yorick?= Python 0 07-17-2007 05:53 PM
removing a namespace prefix and removing all attributes not in that same prefix Chris Chiasson XML 6 11-14-2006 05:08 PM
Composite Control with FormView property tag prefix attribute? Martin ASP .Net Building Controls 0 07-09-2006 04:42 PM
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
"static" prefix - to parallel "this" prefix Tim Tyler Java 36 12-10-2004 01:02 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57