I have a few custom controls that were created as Server Controls projects. I had a few changes to make, so I just added the classes to an existing Web Application project so I could have things in one place. This web app project is compiled into a dll that is used on several web projects.
When I build the web app project and place the dll in the bin of a different website, when I go to use the control I get the following error:
Unknown server tag 'CustomControls:RadioButtonListForGrid'
If I add the custom control classes to the app_code folder of my website it works fine. I used the object browser and confirmed that these classes are in the dll.
Am I missing something obvious here? Do I have to leave these as Server Control projects and combine the dlls using ILmerge?
EDIT
Turns out that I needed to add the assembly name. It also turns out that the assembly wasn't named what I thought it was. Guess I should of checked that. Oops.
Did you add the tag prefix to web.config?
<pages>
<controls>
<add tagPrefix="CustomControls" namespace="MyApp.CustomControls" ...
I can confirm it, adding assembly name in the Register directive works! So it's a must even if it's the same assembly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With