Last post Nov 07, 2007 09:34 PM by david wendelken
Nov 07, 2007 06:20 PM|MParkhouse|LINK
I have a server control that isn't working correctly. I'm trying to set up a new website, move the .vb file that contains the control to this new website and reference the control that is in the .vb file. My problem is that I can't register the control.
Here is my namespace declaration:
It is not a dll at this point but I want to set up a calendar using the one described in this .vb file (named haa_CalendarControlLarge.vb).
I can move the dll in and register it just fine but then I can't debug it. I'm really in a bind and would appreciate any help.
Nov 07, 2007 07:01 PM|DMAR78|LINK
If the website you want to move this control to is 2.0 and you're using VS2005 then add the file to the App_Code folder. Then, you do one of two things:
1.) on the page you want to use the controls, you would do a @register TagPrefix="HAA" namespace="HAA_Controls" at the top of the page in a directive syntax
2.) you can also edit your web.config and put this in the <Pages><Controls> section so that ALL pages will be able to access the control.
If this isn't 2.0 then you'll need to compile it into a DLL and then register it the same way, but you will also add assembly="whateveritendsupbeing.dll"
Hope that helps
Nov 07, 2007 09:34 PM|david wendelken|LINK
I put my custom controls in one project, and my web pages in another.
When I am debugging the custom controls, I tend to put the custom controls in the same solution as the web project.
Once the controls work, unless they really are part of the business code instead of general purpose utility controls, I take that project out of the solution and reference the DLL instead.