Last post Feb 08, 2011 10:31 PM by decker dong - msft
Feb 07, 2011 11:26 AM|Roblem|LINK
I have several projects that utilize the same basic control. Currently this is implemented as a WebUser Control. (ascx) this ascx control. For each project that uses it, all its files would then be copied to each project/or soultion that required the logic
and UI it provided.
If code the logic was changed in one solution/project, then all other projects/soultions would become unsynced and the code diverged.
To create a control in a seperate project, that can then be added to the "toolbox" in a project that requires it. That project would be part of a solutiont that references the "shared project". At that point any code changes in the source/shared project
would be reflected in the projects that use it. Providing a single location to make any code/ui updates. (we do this with all our data and business object libraries already)
IT appears that this is not possible via an ascx control and that only a server control can add this type of functionality. So. if our ascx control uses other asp.net controls like multiview/view/datagrid & datapaging controls, how would you go about makeing
the server control?
Is this possible? if yes, can you point me to an article online or provide a source I can reference.
So far the closest soultion I have managed to find requires compling the "codebehind" into a dll (via project deploy) and, referencing the project and copying the ascx file into each project that uses it. Then changes in the logic are reflected, however
interface changes would require that you copy the interface to each project that uses it. Providing at least an opportuitiy to get parts of the project out of sync.
This also doesn't provide tool box access to the widget.
Feb 08, 2011 10:31 PM|Decker Dong - MSFT|LINK
If you want to distribute a server-side control. I'm afraid you will have to use a template of AspNetWebControl to deal with the problem instead of using ascx control directly. Because it will only let you use in one project. And you will have to compile
it and package it into the formation of dll and export it to others. No other ways according to my limit knowledge until now...