Can't get TagPrefix to work for custom Web control

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

  1. #1

    Default Can't get TagPrefix to work for custom Web control

    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
    Michael Skelton Guest

  2. Similar Questions and Discussions

    1. using TagPrefix to avoid having @ Register directives on pages using custom controls
      Hello, I am designing a custom control in a seperate DLL. I have used the assembly:TagPrefix attribute in this project. The project is included...
    2. Keep custom property-value in custom rendered control
      Hi there, here's the thing I have a custom control (rendered) with a label, textbox and some validators. I use that for entering a birthdate, to...
    3. ControlDesigner not invoked on custom control when control is rendered within another custom control
      I have a custom control that has a simple designer (derived from System.Web.UI.Design.ControlDesigner) associated with it (using the...
    4. Why doesnt custom TagPrefix work in controls made w/ VBNET?
      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?
    5. Using Table control in a custom composite control. Control does not render properly in design time.
      All, I have written a very simple custom composite control that includes a control of type System.Web.UI.WebControls.Table. The control...
  3. #2

    Default Re: Can't get TagPrefix to work for custom Web control

    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" <anonymous@discussions.microsoft.com> wrote in message
    news:92A533F2-638E-4CA0-8B4F-D9788111ED2D@microsoft.com...
    > 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

    JohnnyV Guest

  4. #3

    Default Re: Can't get TagPrefix to work for custom Web control

    Thanks for the advice, I'll try that.
    Michael Skelton 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