Okay, I've been banging my head against this for almost five hours now, so I figure it's time to ask.
I'm working on a Web App (.NET 4.0, C#, ASP.NET, AJAX, jQuery) in Visual Studio 2010 (Professional) that has several parts. Let's call them Mo, Larry, and Curly, with each residing in a subfolder of the project. Currently, each has several User Controls, stored in a subfolder named Controls underneath their specific folder, and all of these controls are declared in the root web.config.
So we have something looking like this:
WebApp - Web.config
--Mo
----Controls
--Larry
----Controls
--Curly
----Controls
I am attempting to better "modularize" the Web App, and would like to be able to (without success so far) move the User Control declaration into nested Web.configs so that they cannot be referenced globally. I have tried to do this by just moving the control declarations into Web.configs that sit in the Stooge-named folders. Intellisense complains that they aren't known elements, but it works as long as I don't try to make any modifications to the page(s) that uses the controls. As soon as I do, (even something as simple as pressing Enter
for a new line) the designer freaks out and removes the reference to the control.
I have tried web.configs in the named folders as well as the sub Controls folders. I have tried including the namespaces inside the web.configs at both levels as well.
So, anyone have any ideas?
Sample web.config declaration:
<?xml version="1.0"?>
<configuration>
<system.web>
<pages>
<controls>
<add tagPrefix="curlyctrl"
src="~/Curly/Controls/NuykNuyk.ascx"
tagName="joke"/>
</controls>
</pages>
</system.web>
</configuration>