473,772 Members | 2,965 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to share user control between multiple websites

I'm using asp.net 2.0 and c# and would like to share some user control
between several websites. these websites are on the same server and have a
physical location right next to each other like this:

D:\Websites\Web site1
D:\Websites\Web site2

I'm thinking of putting the controls for sharing in a common directory like
this:
D:\Websites\Com monControls

What's the recommened way to do this and are there any special
conciderations to keep in mind?

FYI: These shared controls will be accessing databases and reading/writing
images to the directory.
Thanks

--
mo*******@noema il.noemail
Mar 11 '07 #1
9 4296
I'm actually working out my own user control problem. In my searches I
stumbled upon this:
http://aspadvice.com/blogs/ssmith/ar...n-ASP.NET.aspx

Maybe it will help :)
Brad

"moondaddy" <mo*******@noem ail.noemailwrot e in message
news:ei******** ******@TK2MSFTN GP04.phx.gbl...
I'm using asp.net 2.0 and c# and would like to share some user control
between several websites. these websites are on the same server and have
a physical location right next to each other like this:

D:\Websites\Web site1
D:\Websites\Web site2

I'm thinking of putting the controls for sharing in a common directory
like this:
D:\Websites\Com monControls

What's the recommened way to do this and are there any special
conciderations to keep in mind?

FYI: These shared controls will be accessing databases and
reading/writing images to the directory.
Thanks

--
mo*******@noema il.noemail

Mar 11 '07 #2
On Mar 11, 9:34 pm, "moondaddy" <moonda...@noem ail.noemailwrot e:
I'm using asp.net 2.0 and c# and would like to share some user control
between several websites. these websites are on the same server and have a
physical location right next to each other like this:

D:\Websites\Web site1
D:\Websites\Web site2

I'm thinking of putting the controls for sharing in a common directory like
this:
D:\Websites\Com monControls

What's the recommened way to do this and are there any special
conciderations to keep in mind?
Consider to build a Class Library or Web Control Library.
http://www.codeguru.com/csharp/.net/...le.php/c12725/

Mar 11 '07 #3
"Alexey Smirnov" <al************ @gmail.comwrote in message
news:11******** **************@ s48g2000cws.goo glegroups.com.. .
>What's the recommened way to do this and are there any special
concideratio ns to keep in mind?

Consider to build a Class Library or Web Control Library.
http://www.codeguru.com/csharp/.net/...le.php/c12725/
Yep, that's definitely the way...
Mar 11 '07 #4
Thanks for your replies.

These user controls are more like content pages rather than a specific type
of control with functionality like a grid or something. in many cases they
just have static text. I have 2 websites that could share some common
content (webforms, html pages, or user controls). I thought it would be
easier to maintain the content (update the text from time to time) if it
were in one place rather than redundantly placed in each site.

does this change your advice?
"Mark Rae" <ma**@markNOSPA Mrae.comwrote in message
news:eU******** ******@TK2MSFTN GP04.phx.gbl...
"Alexey Smirnov" <al************ @gmail.comwrote in message
news:11******** **************@ s48g2000cws.goo glegroups.com.. .
>>What's the recommened way to do this and are there any special
concideration s to keep in mind?

Consider to build a Class Library or Web Control Library.
http://www.codeguru.com/csharp/.net/...le.php/c12725/

Yep, that's definitely the way...

Mar 12 '07 #5
"moondaddy" <mo*******@noem ail.noemailwrot e in message
news:O5******** ********@TK2MSF TNGP06.phx.gbl. ..
These user controls are more like content pages rather than a specific
type of control with functionality like a grid or something. in many
cases they just have static text. I have 2 websites that could share some
common content (webforms, html pages, or user controls). I thought it
would be easier to maintain the content (update the text from time to
time) if it were in one place rather than redundantly placed in each site.

does this change your advice?
Not at all, though a full-blown web control library might be a bit overkill
if we're talking only of a few small files...

Another way would be to use a product such as Microsoft Visual SourceSafe...
Apart from the source control functionality (which every serious developer
should be using anyway...), this allows individual files to be "shared"
across multiple projects. Although a copy of the file does exist separately
in each project, when you update it in one project it gets updated in all
other projects into which it has been shared...

I use this quite a lot for things like individual debugging pages which I
always add to every public internet web app I build...

Depending on which version of Visual Studio.NET you have, you probably
already have a copy of Visual SourceSafe...
Mar 12 '07 #6
Hello Moondaddy,

Naturally, ASP.NET usercontrol(asc x) is not designed for reuse scenario,
just like aspx pages. Scottgu has ever posted a blog article demonstrate
how to make ASP.NET acsc usercontrol and page reusable in multiple projects
in ASP.NET 2.0:

#Building Re-Usable ASP.NET User Control and Page Libraries with VS 2005
http://weblogs.asp.net/scottgu/archi...28/423888.aspx

However, such approach has some certain natural limitations due to the
underlying design and implementation of usercontrol. If possible, I would
recommend you consider other means to build those reusable components. Such
as create custom webserver controls, or just define some shared include
files that be used in multiple projects.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 12 '07 #7
It doesn't matter where you put the files for the controls or how you
use them, as the two web sites are separate applications, you will
always have a separate instance of the user controls for each application.

If you want to share data between the applications, you have to do it on
a lower level, like creating a windows service that runs on the server
that both applications can communicate with.

--
Göran Andersson
_____
http://www.guffa.com
Mar 12 '07 #8
Thanks to all. it sounds like a shared include file would be the way to go.
Can you recommend a resource describing how to use a shared include file in
such a scenario?

Thanks.
"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:HS******** ******@TK2MSFTN GHUB02.phx.gbl. ..
Hello Moondaddy,

Naturally, ASP.NET usercontrol(asc x) is not designed for reuse scenario,
just like aspx pages. Scottgu has ever posted a blog article demonstrate
how to make ASP.NET acsc usercontrol and page reusable in multiple
projects
in ASP.NET 2.0:

#Building Re-Usable ASP.NET User Control and Page Libraries with VS 2005
http://weblogs.asp.net/scottgu/archi...28/423888.aspx

However, such approach has some certain natural limitations due to the
underlying design and implementation of usercontrol. If possible, I would
recommend you consider other means to build those reusable components.
Such
as create custom webserver controls, or just define some shared include
files that be used in multiple projects.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Mar 12 '07 #9
Thanks for your reply Moondaddy,

About referencing include template in ASP.NET here are some public article
you can refer to:

#How To Dynamically Include Files in ASP.NET
http://support.microsoft.com/kb/306575

#ASP.NET Page Templates - Using Inheritance
http://www.codeproject.com/aspnet/page_templates.asp

#Using include files with ASP.NET
http://www.christopherjason.com/arti...ludes-asp-net/

#Simulating include Files with an ASP.NET Server Control
http://msdn2.microsoft.com/en-us/library/aa479009.aspx

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Mar 13 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8413
by: AARON PECORARO | last post by:
I need to split apart my web application into multiple projects to allow it to be distributed in parts, but all of the projects need to work together (ie. they need to share session information). Does anyone have any suggestions or solutions to this problem? Thanks, Richard Bowman
4
3629
by: Jay Mack | last post by:
Hello, I converted an Access application that used to have a MDE front-end (distributed to each user) with a MDB back-end on a share. It now has a MDE front-end with linked ODBC SQL Server 2000 tables as the back-end. Is it a bad practice to place the MDE front-end on a network share instead of sending a copy to each user? I want to do this as a form of cheap security, since the network share has access control on it. Previously, the...
2
1785
by: Eric | last post by:
I have a header server(.ascx) control that I want to use with all my existing seperate web apps. These web apps are configured as seperate web apps in IIS but when I try to build my solutiuon referencing an ..ascx that lives outside the application I get a failure. Is there any way to have a global ascx file that multiple seperate applications can use? Thanks
6
1621
by: Tony Fonager | last post by:
I am currently developing a statistics system in ASP.NET, and need to share information about the customers websites, in this application. (I have simplified my code, to make my project easier to explain.) The simple version of the system is like this : A customer inserts HTML code on his webpage, which contacts my statistics server each time the customers website recieves a hit - like a classic "register website traffic" system. ...
8
4556
by: Tony Fonager | last post by:
I am currently developing a statistics system in ASP.NET, and need to share information about the customers websites, in this application. (I have simplified my code, to make my project easier to explain.) The simple version of the system is like this : A customer inserts HTML code on his webpage, which contacts my statistics server each time the customers website recieves a hit - like a classic "register website traffic" system. ...
5
5098
by: Raed Sawalha | last post by:
We have a web application with at least 570 Pages and 10's of user controls ....all under project name LinkDevProject ...recently we start separating the project into multiple projects ....the problem we have in user controls how to share them without duplicate the control in each project ....we need to remain the controls in main project and all subproject use them .....what is the avaiable technique to achieve this?
2
14980
by: mail | last post by:
Hi guys, So far I've spent about a week hacking away at this code, and I just can't get it to add an ACE to a the DACL for a network share using WMI. Just to set the scene, I'm trying to add an ACL from machine A (workstation; Saturn) and set it to a UNC path (\\Mercury\Inetpub\Websites\LocalUser\Test) on machine B (server; Mercury).
15
5816
by: Neo | last post by:
Hello All, I found that ASP.net website only accepts code withing site directory. This creates big hurdle in shairng code. How to share code between two websites, like the way share between two non-website code? -Pravin
3
1883
by: Jonathan Wood | last post by:
I could really use some help on this. First of all, I want to create a Web control where I render the control completely from scratch based on information from a database. In the book "Beginning ASP.NET 2.0 in C# 2005", it provides an example of doing this, which is declared as: public class ConfigurableRepeater : WebControl.
0
10104
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8934
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.