ASP. NET web projects cannot add Web User Controls

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.