When you use an enterprise-level template to build a multi-layer project, you cannot add Web user controls to the web project added to the solution. Even if the option "add Web user control" exists in the Add menu, the Web user control is changed to a form after being added. this error is mainly caused by the policy file of the project. the default policy file of the Project is generally stored in: C: \ Program Files \ Microsoft Visual Studio. NET 2003 \ javasiseframeworks \ Policy directory, named DAP. tdl: After the Default policy file is used, the user control cannot be added to the web project. This policy file is complicated. If you do not know the structure of the policy file very well, it is difficult for you to modify it in a short time to suit your project requirements.
Solution:
Open your project file *. csproj and move it to the bottom. The following code is displayed:
</Files>
<Startupservices>
<Service id = "{CF845C55-C321-4742-B673-E6212D061ED9}"/>
</Startupservices>
<Userproperties
Tdlfile = ""
Tdlelementtype = "webui"
/>
</CSHARP>
</Visualstudioproject>
Note that the setting of my tdlfile item is equal to null, and the default setting is equal to Dap. tdl file. if it is set to null, this project is not restricted by the policy file. you can simply add file types to projects.
Of course, it is best to modify the policy file to achieve your goal. Without policy file management, developers may not be able to block the need to add unnecessary files to the project.