Change the tag prefix of a custom control

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Change the tag prefix of a custom control

    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

    shapper Guest

  2. Similar Questions and Discussions

    1. Composite Control with FormView property tag prefix attribute?
      Hi, I've developed a Composite control designed to take one FormView and one SqlDataSource as properties. I can add my composite control to the...
    2. Custom web control not responding to change
      Hi, Since I ran into a problem with nested user web controls I decided I was (???) better off implementing this as a custom web control. Well, I...
    3. Web Custom Control, design-time property doesn't change attribute
      Hi, This seems to be a simple problem, but I am unable to figure out what is wrong: I have a Web Custom Control, with two properties (both are...
    4. Create a custom control to change the page theme
      Hi. Anyone knows how can I change the theme from my custom control. My custom control render a dropdownlist with the availables themes, getting in...
    5. Properties pane of custom control doesn't change in design time
      Hi, I have implemented the code similar to the one on the link:...
  3. #2

    Default Re: Change the tag prefix of a custom control

    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
    [url]http://blogs.aspadvice.com/joteke[/url]

    "shapper" <mdmoura@gmail.com> wrote in message
    news:1160503164.210486.158520@e3g2000cwe.googlegro 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
    >

    Teemu Keiski Guest

  4. #3

    Default Re: Change the tag prefix of a custom control

    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
    > [url]http://blogs.aspadvice.com/joteke[/url]
    >
    > "shapper" <mdmoura@gmail.com> wrote in message
    > news:1160503164.210486.158520@e3g2000cwe.googlegro 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
    > >
    shapper Guest

  5. #4

    Default Re: Change the tag prefix of a custom control

    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
    [url]http://blogs.aspadvice.com/joteke[/url]



    "shapper" <mdmoura@gmail.com> wrote in message
    news:1160529906.415724.131200@i3g2000cwc.googlegro 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
    >> [url]http://blogs.aspadvice.com/joteke[/url]
    >>
    >> "shapper" <mdmoura@gmail.com> wrote in message
    >> news:1160503164.210486.158520@e3g2000cwe.googlegro 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
    >> >
    >

    Teemu Keiski Guest

  6. #5

    Default Re: Change the tag prefix of a custom control

    look at the attribute [assembly:TagPrefix()]

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



    "Teemu Keiski" <joteke@aspalliance.com> wrote in message
    news:%23EvHtgw7GHA.2120@TK2MSFTNGP03.phx.gbl...
    > 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
    > [url]http://blogs.aspadvice.com/joteke[/url]
    >
    >
    >
    > "shapper" <mdmoura@gmail.com> wrote in message
    > news:1160529906.415724.131200@i3g2000cwc.googlegro 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
    > >> [url]http://blogs.aspadvice.com/joteke[/url]
    > >>
    > >> "shapper" <mdmoura@gmail.com> wrote in message
    > >> news:1160503164.210486.158520@e3g2000cwe.googlegro 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
    > >> >
    > >
    >
    >

    gerry Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139