using TagPrefix to avoid having @ Register directives on pages using custom controls

Discussion in 'ASP .Net Building Controls' started by Shan McArthur, Jun 29, 2005.

  1. 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 as a
    reference in our website project. I can use my custom control if I have a @
    Register directive in my page, but I want to develop this control in a
    manner that does not require this directive on each and every page in my
    website (and other websites that use this control). Is there any way to
    register the control so that this is not required? None of the .net
    controls need this special directive.

    Thanks,
    Shan McArthur
     
    Shan McArthur, Jun 29, 2005
    #1
    1. Advertising

  2. Hi Shan,

    Welcome to ASPNET newsgroup.
    Regarding on the Registering Custom control prefix problem, based on my
    research, I'm afraid this is limited by the currently ASP.NET page/control
    parsing model. For those buildin controls ( with "ASP" prefix), they're
    registered internally when parsing the Page and Controls. And there hasn't
    provide any configuration elements for registering custom control in
    web.config or machine.config. Currently we can only declare assembly
    referencing in web.config / machine.config through the
    compilation/assemblies element like:

    <system.web>
    ..............
    <compilation>
    <assemblies>
    <add assembly="ADODB"/>
    <add assembly="*"/>
    </assemblies>
    </compilation>
    </system.web>

    which can replace the @ Assembly directive in aspx page.
    But for @Register, currently we have to always declare it in aspx for our
    custom controls.

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
     
    Steven Cheng[MSFT], Jun 29, 2005
    #2
    1. Advertising

  3. RE: using TagPrefix to avoid having @ Register directives on pages

    If you look at custom controls written by other companies, you will see that
    they write out the @Register tag as well.

    With the Infragistics components, if I drag a UltraWebGrid from the toolbox
    onto my webform, the @Register tag is autogenerated for me. In addition, the
    license file in my web project's root is updated.

    If you have access to the source of a 3rd party control, or google, you
    could probable find a way to automate this process for yourself as well.

    --
    Staff Consultant II - Enterprise Web Services - Cardinal Solutions Group

    Future Business Model - National City Mortgage


    "Steven Cheng[MSFT]" wrote:

    > Hi Shan,
    >
    > Welcome to ASPNET newsgroup.
    > Regarding on the Registering Custom control prefix problem, based on my
    > research, I'm afraid this is limited by the currently ASP.NET page/control
    > parsing model. For those buildin controls ( with "ASP" prefix), they're
    > registered internally when parsing the Page and Controls. And there hasn't
    > provide any configuration elements for registering custom control in
    > web.config or machine.config. Currently we can only declare assembly
    > referencing in web.config / machine.config through the
    > compilation/assemblies element like:
    >
    > <system.web>
    > ..............
    > <compilation>
    > <assemblies>
    > <add assembly="ADODB"/>
    > <add assembly="*"/>
    > </assemblies>
    > </compilation>
    > </system.web>
    >
    > which can replace the @ Assembly directive in aspx page.
    > But for @Register, currently we have to always declare it in aspx for our
    > custom controls.
    >
    > Thanks,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
     
    Michael Baltic, Jun 30, 2005
    #3
    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. Kristoffer Arfvidson

    Register TagPrefix ?? really a good idea?

    Kristoffer Arfvidson, Jan 23, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    5,479
    Kristoffer Arfvidson
    Jan 24, 2004
  2. Nathan Sokalski
    Replies:
    5
    Views:
    1,084
    Gaurav Vaish \(www.Edujini-Labs.com\)
    Jan 10, 2007
  3. Nathan Sokalski
    Replies:
    4
    Views:
    341
    Nathan Sokalski
    Dec 21, 2006
  4. Luis Ramírez
    Replies:
    0
    Views:
    176
    Luis Ramírez
    May 21, 2004
  5. Nathan Sokalski
    Replies:
    4
    Views:
    378
    Nathan Sokalski
    Dec 21, 2006
Loading...

Share This Page