Can't get TagPrefix to work for custom Web control

Discussion in 'ASP .Net' started by =?Utf-8?B?TWljaGFlbCBTa2VsdG9u?=, Feb 12, 2004.

  1. 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
    =?Utf-8?B?TWljaGFlbCBTa2VsdG9u?=, Feb 12, 2004
    #1
    1. Advertising

  2. Michael,

    I tested out both scenarios to make sure everything worked: I went to
    http://msdn.microsoft.com/library/d...vbwlkWalkthroughCreatingCustomWebControls.asp
    (watch the URL wrap) and followed the instructions for this so that I did
    not miss anything, and I made things look like:

    AssemblyInfo.cs

    using System.Web.UI;
    .....
    [assembly: TagPrefix("CustomLabel", "mas")]


    CustomLabel.cs

    namespace CustomLabel
    {
    public class WebControlLibrary1 ....
    }

    and I did one with the namespace="CustomLabel.TestLabel" and [assembly:
    TagPrefix("CustomLabel.TestLabel", "mas")] and everything works when I add
    it to the toolbox and then drag it over to the IDE in VS.

    Any more info that you could post like the @Register statement in the HTML
    view of the IDE when you drag and drop it on the page?

    HTH. Give me more info and I can see what else if available.

    Ben Miller

    --
    Get Secure! - www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.


    "Michael Skelton" <> wrote in message
    news:...
    > 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
    Ben Miller [MSFT], Feb 14, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Showjumper
    Replies:
    5
    Views:
    435
    Showjumper
    Jul 17, 2003
  2. Bob
    Replies:
    1
    Views:
    498
    Raymond Lewallen
    Jun 23, 2004
  3. Michael Skelton

    Can't get TagPrefix to work for custom Web control

    Michael Skelton, Feb 12, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    109
    Michael Skelton
    Feb 13, 2004
  4. Shan McArthur
    Replies:
    2
    Views:
    175
    Michael Baltic
    Jun 30, 2005
  5. Michael Skelton

    Can't get TagPrefix to work for custom Web control

    Michael Skelton, Feb 12, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    108
    Michael Skelton
    Feb 12, 2004
Loading...

Share This Page