Re: ASP.NET - multiple applications sharing pages/ controls

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Shan Plourde (------_at_---.net)
Date: 07/28/04


Date: Wed, 28 Jul 2004 04:53:52 GMT

The approach that I have been using (small scale in house projects) is
to create shared assemblies that I register in the GAC. These shared
assemblies contain my code behind logic. Then in each web application, I
have an .ascx page that extends from the code behinds in the shared
assemblies.

In general I favor this to custom controls in many situations because I
find that it is much much easier to make stylistic changes.

We have had support for symbolic links to files since Windows 2000. I
have used this with success across multiple web applications. I use it
at times for .ascx files that I wish to reuse in other web applications.
You can have your shared .ascx files deployed in the same area as your
shared assemblies that contain your code behinds. I think that this is
good for reuse at a smaller scale.

John Saunders wrote:

>"Shikari Shambu" <shikarishambu70@hotmail.com> wrote in message
>news:e4eoatBdEHA.3620@TK2MSFTNGP10.phx.gbl...
>
>
>>Hi All,
>> I have a situation where multiple applications are sharing some pages/
>>controls.
>>
>>So, I have a separate common project that has the common pages/ controls.
>>
>>My question is how do I reference these pages/ controls from my ASP.NET
>>
>>
>web
>
>
>>projects
>>
>>WEbApp1 url http://localhost/app1 C:\Apps\App1
>>WEbApp2 url http://localhost/app2 C:\Apps\App2
>>Common C:\Apps\Common
>>
>>And, what are the best practices for scenarios like this
>>
>>
>
>ASP.NET isn't really set up to work like this.
>
>In order to share controls, you should create custom controls instead of
>user controls. Multiple site can share the assembly containing the custom
>controls.
>
>You can share pages by placing the shared pages into a separate web
>application. Then, both App1 and App2 can have links to the shared pages in
>App3.
>
>And, of course, you can share common types in an assembly which both web
>applications reference.
>
>



Relevant Pages

  • Re: ASP.NET - multiple applications sharing pages/ controls
    ... The approach that I have been using (small scale in house projects) is ... to create shared assemblies that I register in the GAC. ... In general I favor this to custom controls in many situations because I ... at times for .ascx files that I wish to reuse in other web applications. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Steps needed when deploying C# application?
    ... If you want to add assemblies to the GAC, then yes, you will have to generate a strong name key. ... Serviced components also have to be strong named. ... custom controls we've developed. ...
    (microsoft.public.dotnet.languages.csharp)
  • Custom controls: File or assembly name Dlya.UiLibrary, or one of its dependencies, was not found.
    ... I have some custom controls in an assembly named Dlya.UiLibrary. ... the controls in the Visual Studio ToolBox and I use its, ... The assembly have reference to others assemblies, ... it seems that the Visual Studio couldn't load it. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: using <runtime> section in web.config file
    ... web applications, since that page specifies that: ... "If the assembly has a strong name, the codebase setting ... file to specify that the runtime should search for assemblies in ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP.NET - multiple applications sharing pages/ controls
    ... > to create shared assemblies that I register in the GAC. ... > In general I favor this to custom controls in many situations because I ... > at times for .ascx files that I wish to reuse in other web applications. ... I have a separate common project that has the common pages/ ...
    (microsoft.public.dotnet.framework.aspnet)