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

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

  1. #1

    Default 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 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 Guest

  2. Similar Questions and Discussions

    1. Using Web.config's <system.web><pages><controls><add /></controls></pages></system.web> To Register UserControls
      My Web.config file contains the following section to register some of my UserControls: <pages> <controls> <add tagPrefix="NATE"...
    2. 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...
    3. Avoid including @ Register tag on every page
      I have written several custom web controls for my aspx pages. In order to use any of them, I need to include the following line of code at the top...
    4. The lifecycle of ASP.NET pages and custom controls
      Reading this at the moment http://www.pcquest.com/content/coding/103050501.asp "Billy Porter" <billy@xymox.com> wrote in message...
    5. 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?
  3. #2

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

    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! [url]www.microsoft.com/security[/url]
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Steven Cheng[MSFT] Guest

  4. #3

    Default 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! [url]www.microsoft.com/security[/url]
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    Michael Baltic 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