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

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.

Advertisements

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:

Advertisements

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.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!