C# - Sharing User Controls Across Multiple Websites?

Apr 14, 2010

I am currently working on a project which involves three different websites with a lot of common functionality. At the moment the common functionality is placed in a different website full of user controls.

The problem is sharing the user controls across the multiple websites. Looking around on SO and other websites, the only solution seems the be using virtual directories. As this is a workable solution (we us this at the moment) it doesn't seem as a "clean" solution.

Which "best practices" exist on sharing common functionality (including the GUI/HTML) between different site?

Is it (for example) possible to create a single Web Application project and deploy subdirectories (each with their own web.config) to different production environments?

View 3 Replies


Similar Messages:

Sharing Cache Between Multiple Websites

Mar 11, 2011

We have about 50 web-sites, running in different application pools, that read from a common cache database (using Microsoft Enterprise Library Caching application block). We currently have a console application which populates the cache at 3AM every morning. However, we want to get rid of this application and get the cache to automatically refresh expired items, using the ICacheItemRefreshAction interface.

We were going to create our cache object in the Global.asax of each of the 50 web-sites. However, my concern is that if we set a cache-expiration policy in Global.asax, that each of the 50 web-sites will trigger a refresh action, causing the data to be re-cached 50 times. We don't want only 1 web-site to set the expiration policies, as then the 49 other web-sites will have a dependency on that 1 web-site, and that's an architecture no-no.

View 2 Replies

Web Forms :: Sharing A Structure Or Class Among Multiple User Controls?

Feb 2, 2010

I'm building an application where custom modules may be developed and "dropped in" to the system, where they can be picked up and utilized.

I'm building a forum module and have a user control to create a login/registration region. I plan on using a struct to store the user session data. However, i need this class structure to be shared between the forum module and the login/registration control.

Because the functionality is to be contained in the module's folder, i cant add any assemblies to the app_code folder.

How can i share a class or struct among two user controls?

View 6 Replies

Sharing Web(.aspx) Pages Across Websites?

Jan 11, 2011

I am looking for an tried-and-tested approach to share .ASPX webpages across websites. E.g. I have a generic error page which I would like to share between x.com and y.com sites.

View 3 Replies

State Management :: Session Sharing Between Two Websites?

Aug 13, 2010

I have a website A which has a link to website B which is currently opening in a different window. When clicked on a link to, the login for B is automatically taken care of as both the websites have same user login credentials.

Now a change in the system has made me embed website B into website A. ie., B will open in the same window of A.. I could achieve this using an IFrame. Now, the session from site A needs to be carried out to site B. Presently, when navigated from A to B, all the sessions on A expire. Once navigated to B the session time out of B from the webconfig is taken. I have used "InProc" as my state management option in web config. Is it possible to maintain single session for both the webistes? If not how to continue same session times for both webistes? I do not want to use "SQL server" state mode.

View 4 Replies

Security :: Sharing Login Between Three Websites (application)?

Jul 5, 2010

I have a scenario with three applications:

1) Portal: where user executes login

2) Site1: after login at "Portal" user is able to use Site1

3) Site2: after login at "Portal" user is able to use Site2

I just need to execute a validation in Site1 and Site2, to validate if they (users) did login at Portal1.

Something like (in site1 main page page_load).

{
if (notFromPortal)
{
//redirect to Denied.apx
}
}

How can I do this in a simple way? With cookies? Does somebody have a url with sample?

My security requirements are almost zero. I just wanna prevent that user put a url from Site2 in browser and see a Site2 page.

View 1 Replies

Sharing State Databases Between Multiple Apps

Apr 7, 2010

Is it better for a collection of ASP.NET web apps to share the same session database, or should each one have its own? If there is no significant difference, having a single database would be preferable due to easier maintenance. Background My team has an assortment of ASP.NET web apps, all written in either Monorail 1.1 or ASP.NET MVC 1.0. Each app currently uses a dedicated session state database. I'm working on adding a new site to that list, and am debating whether I should create another new session database, or just share an existing one with another app.

View 1 Replies

Web Forms :: Sharing CSS Files Across Multiple Projects?

May 5, 2010

I am trying to add multiple CSS files across several projects and have added them as a "link" but when I build my solution it does not copy the files. Is there any way to share a bunch of CSS files across several projects?

View 7 Replies

Multiple ScriptControl Instances Sharing Variable?

Oct 20, 2010

I have a ScriptControl that uses an image as an embedded resource and GetWebResourceUrl to generate the WebResource.axd URL. I am currently using GetScriptDescriptors() to send the URL to the JavaScript object.The ScriptControl can be in a Repeater, so you may have 20+ instances. They all use the same images (not customizable through property), so I would like to set the URL once in a variable and share it. I know I could register a script block with a global variable, but would like to avoid that if possible. Is there a way to set a variable within the scope of the control type (global -> control type -> control instance)?

View 1 Replies

MVC :: Creating Solution With Multiple And Sharing Namespaces Across Projects

May 25, 2010

If MVC application has multiple projects (The solution may grow large in future). These projects may share controllers such as application controller accouts controller and there may also be a situation in which namespace of one project is shared by other project. What is the best way of implementing such solution. One approach may be to use areas.

View 4 Replies

How To Setup For Sharing Code Across Multiple Domain Names

Mar 8, 2010

I have built a website and now the customer wants to split it between three different domains. What is the best way to do this? This is what I have so far.

c:/website1/ points to www.website1.com
c:/website1/vd1/ points to www.website2.com
c:/website1/vd2/ points to www.website3.com

The webhost I'm working with has done it the following way, but now I'm getting a bunch of errors that seems like it's not seeing the App_code folder. Do I need to make a lot of changes? How does this affect the location references?

View 2 Replies

How To Prevent Multiple Browser Windows From Sharing The Same Session?

Mar 25, 2010

I have ASP.net application that is basically a data entry screen for a physical inspection process. The users want to be able to have multiple browser windows open and enter data from multiple inspections concurrently. At first I was using cookie based sessions, and obviously this blew up.I switched to using cookie-less sessions, which stores the session in the URL and in testing this seemed to resolve the problem. Each browser window/tab had a different session ID, and data entered in one did not clobber data entered in the other.

However my users are more efficient at breaking things than I expected and it seems that they're still managing to get the same session between browsers sometimes. I think that they're copying/pasting the address from one tab to the other in order to open the application, but I haven't been able to verify this yet (they're at another location so I can't easily ask them).Other than telling them don't copy and paste, or convince them to only enter one at a time, how can I prevent this situation from occurring?

View 5 Replies

Multiple Browser Tabs/windows Sharing Data?

Jan 27, 2010

I have a page where I display ASP.NET charts. There are two types of charts and I felt the need to separate them to some extent which I did by using a submenu which looks like this:

Charts > Goals Charts
> Reconciliation Charts

Clicking on either of the two chart links will take you to the same Charts.aspx page, but with the query string "Goals" or "Reconciliation" respectively. On the page load of the Charts.aspx page, I receive the query string into a session variable and create the correct charts based on that value. All of this works fine.

The problem I'm experiencing occurs when I open up a new tab in IE/Firefox. Here is the series of events I'm experiencing:

- In the original tab, I will click on the "Goals Charts" hyperlink which loads the Charts.aspx page with "Goals" as the charts type session value. The other controls on the page needed to produce "Goals" charts (eg. drop down lists, etc) are displayed correctly ie. the "Goals" version. At this point, I haven't done anything in this tab except for loading the Charts.aspx page from the "Goals Charts" link.

- In the original tab, I right click the "Reconciliation Charts" link and opt to open in a new tab (I just tested and the same thing appears to be working if you opt to open in a new window as well). When the new tab loads the Charts.aspx page, it loads with the query string "Reconciliation" which it stores in the session variable. So at this point I would expect to have two different, independent tabs: the original tab on the "Goals Charts" track and the second tab on the "Reconciliation Charts" track.

- This is where the problem occurs. I would expect the original tab/window to create a "Goals" chart when I make a selection using the other controls and I would expect the second tab/window to create a "Reconciliation" chart. The problem, however, is that when I go back to the original tab/window - the one which should be a "Goals" chart and which should have "Goals" stored in the session value - when I proceed to create a chart, it's a Reconciliation chart that is created.

Somehow, even though I'm in a different tab or window and I am navigating the site seemingly independently of the other tab/window, it seems to be carrying the most recently populated value from the session variable for both tabs/windows.

View 5 Replies

How To Have Common Layout For Multiple Websites

Dec 18, 2010

we are working on a portal which will have multiple websites sites loaded in same container meaning there will be a

1)Top Header showing Portals name and currently loaded app's name

2)left hand side frame having menu which will list applications which are independent of one another.Each of these application is hosted on different servers sharing same DNS name for ex .

i) [URl]

ii) [URl]

3) Righ hand frame ::this is very individual applications pages will load with there own submenu.

Now top header and left hand side menu are common across the applications while the contents in right hand frame will application specific. How can I achieve this using master page ,without requiring indivdual application to have same master page copied in there virtual directory

View 2 Replies

Using A Single Codebase For Multiple Websites?

Mar 30, 2011

There are existing questions that pertain to this subject, but I feel my case may be slightly different(correct me if i'm wrong).

I have two web sites that are almost identical as far as graphics go. They will need only to have a different logo. Additionally I have set up the database so that products can be flagged to show up on either or, or both web sites. Is it possible to set up IIS to point the second web site to the first web site and then have my code determine which domain the request is coming from?

For instance, web site 1 will have domain www.myfirstwebsite.com and the second web site will have a domain like www.mysecondwebsite.com.

If I did go this route I'm guessing I would check in the master page code behinds Page_Load event for the domain and then when I want to display products on my front end I can reference against the variable in the master page.

View 1 Replies

MVC :: One Code Base Multiple Websites?

Nov 12, 2010

I was wondering about the best MVC practices for handling multiple websites from one MVC codebase. The functitonallity will pretty much be the same on all five sites, with most differences coming from styling/branding. Is it possible to dynamically set a Masterpage in MVC ? Should this even be attempted? Can everything get handled cleverly with routing?

View 2 Replies

Web Forms :: Prevent Multiple Browser Windows Or Tabs From Sharing Same Session

Mar 6, 2013

Preventing user to open duplicate web application,while it is running .....

View 1 Replies

Configuration :: How To Create One Web.config For Multiple Websites

Jun 4, 2010

I have 3 web.configs and 1 web project. I compile it once, and when deploy it, all I do is copy the correct web.config to the correct directory.

This is too complicate to maintain, when I have web.config change I must change all the three.

So, what I want is to keep only one web.config file, for all three websites.

In order of doing so, I have created a new settings.xml file, and I wish to read everything from there instead of te web.config file.

to my questions:

1. I need to remove ConnectionString from web.config to the settings.xml file. How do I change the providers connection string programatically?

[Code]....

Seems like moving the connection string to a different file might be a difficult task:)

2. How programatically can I do what I did on the web.config easily:

[Code]....

View 6 Replies

Can Run Multiple Websites Under A Single Membership Database

Jun 8, 2010

I'm trying to plan a series of websites that all share many of the resources such as css/jscript/images/content etc. For this reason I wanted to run all of the websites under the same application and IIS profile, but depending on the URL being used change the masterpage and theme/skin.

The ASP.NET membership database seems as if it was designed with this goal in mind because it allows you to setup multiple applications, however I believe the purpose for which this was built was to allow applications to be run under virtual directories/fodlers, not on seperate urls.

View 2 Replies

Share An In-memory Object Between Multiple Websites?

Feb 1, 2010

We have about 70 sites on our server that use same application (with different Application Pools) and they use for example a shared skin file. So is there a way to load this file to memory and share for all applications? what I mean is to sharing cache in multiple websites to decrease pressure on server.

View 3 Replies

Creating Subdomain In IIS Or Configuring Multiple Websites?

Dec 20, 2010

I have a IIS server in my company which runs our intranet application, We assigned one static IP to it in order to access through internet. when we to mapped our application address eg : http://ip/applicationname to one host name, after loading when i try to access any page it was again showing ip address instead of my host name. When I check with my ISP, he told me that to resolve this either you have to put your application folder in root directory(directly in Inetput/wwwroot) or you have to create sub domain, when I put all my fies to root directory it is working well, but , I found that for all other application which i put the folders inside wwroot are taking the config file from root, how can i resolve it... or just explain me how to configure subdomain in my server to solve this issue....

View 1 Replies

Configuration :: Set Up Multiple Websites In Godaddy's 4G Hosting?

Mar 23, 2011

I just upgraded to windows 4G hosting from old windows hosting on Godaddy. I have hosted multiple websites on this hosting account. The primary domain website [URL] is working fine after the upgrade but all other sites hosted in same account report some errors.

The structure is like this:

Root: inHouseRecipes.com
Root/s/Website1
Root/s/Website2

I have checked that the websites in subfolders are set up as an application in IIS 7. Also, the web.config of parent (root) website has the following

<location
path="."
inheritInChildApplications="false"
>

tag to stop other child web.config to inherit anything from parent.

I use asp.net to code my websites. Before 4G upgrade everything used to work like a charm.
Has anybody else also experiences the same issues? If yes, what are the changes that we need to make to support multiple web sites in same 4G hosting account?

View 5 Replies

Sharing Web User Control Between Various Projects?

Feb 2, 2011

Is there a way to share user controls between various projects ?

I have created user controls like login control, menu control, header control, lost password control and etc and they are all connected to sql database for data.

I would like to share these between various web site projects, it means I have same functionality and the only modifications I can do is within CSS styles.

Do I need to copy modules or is there a way to keep them as shared classes/modules and call what I need every time I need it?

View 1 Replies

Configuration :: VS 2008 Multiple Websites Referencing The Same Files?

Nov 24, 2010

I would like to have several websites that use the same styles, scripts, and App_GlobalResources. What would be the best way to structure my websites (web applications) to use the same files? I also need to share user controls with code behind.

View 6 Replies

Security :: Mixed Mode Authentication Fails In Multiple IIS Websites

Jan 26, 2010

I created a mixed mode authentication mechanism based on a few of the articles that I have read on this topic. It's similar to something like this: [URL]

Basically, there are two web applications. One accepts the Windows Auth and one accepts Forms Auth. The Windows Auth then creates a forms auth ticket and passes control to the Forms auth application. This solution works fine when both applications are housed within the same IIS web site.

Now, order to control the security of this solution we set up multiple IIS web sites on the same machine. Web Site 1 serves external traffic (forms auth) and Web Site 2 serves internal traffic (windows auth).

So the design is that an internal user can hit the site using Windows auth via a internal name (myserver) while the external users use Forms Auth hitting [URL].

All that said, the solution works when the two applications are in the same site. Doesn't work when they are in different sites.

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved