简体   繁体   中英

How to add a user control .ascx to a web form which is in another project in the same solution

I have 2 projects in the solution , the first one is asp.net web service that contains .asmx file and two .ascx files (user control) , then I added empty web site with one web form . I added a web reference of my web service to the web site , Now I want to use the user control in my new web form . how can I do that .

when all the files are in one project it works fine , but the problem is loading the user control in a web form that is not in the same project

If I understood you right, you would like to use one user control in multiple projects. You could ether add it as a reference (using add file >> existing >> browse & select >> add as link). Or if you prefer a "clean" solution, you could create a library and place the control in it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM