Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 645583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:31:08+00:00 2026-05-13T21:31:08+00:00

I have several ASP.NET websites in a solution along with a common C# code

  • 0

I have several ASP.NET websites in a solution along with a common C# code project. Something as follows:

  • Website1
  • Website2
  • …
  • Website(n)
  • Common

First off I want to use a Global.asax file to log all unhandled exceptions. I could have one Global.aspx file per website but all the code will be the same and it seems pointless having to keep multiple copies of the same file upto date. Is there a way to have the Global.aspx file in the Common library and then link to it from each website. I have tried doing Add Exiting Item > Add as Link but it doesn’t get run by the page.

Secondly all the websites need an Error page which I can write information to (not just a simple html page) so I have an Error.aspx page which I want to redirect to along with the error details. Again I could have one per website, but its going to be the same page. Is there a way I can store this in the Common project and link to it? The only solution so far for this I can think of is to have an Error website which has the Error page in it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T21:31:08+00:00Added an answer on May 13, 2026 at 9:31 pm

    You can inherit your Global.asax file from a base class. So your global.asax might look like this:

    <%@ Application Codebehind="Global.asax.cs" Inherits="MyApplication" Language="C#" %>
    

    Then your Global.asax.cs would look something like this:

    public class MyApplication: BaseApplication 
    {
        protected void Application_Start()
        {
            // application specific code... if any
        }
    }
    

    In your library define:

    public class BaseApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            // do your shared code here
            base.Application_Start();
        }
    }
    

    As far as your “global” error page is concerned, what I would do is create a handler (.ashx) page on each website and then make a library method to display your error information. Something like this (Error.ashx)

    <%@ WebHandler Language="C#" Class="errorhandler" %>
    
    public class errorhandler: IHttpHandler {
    
        public void ProcessRequest (HttpContext context) {
            MyLibrary.ErrorHandler(context);
        }
    }
    

    Note: Namespaces not included in example for clarity.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 321k
  • Answers 321k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer myString = myString.replace(/\+/g, ""); May 14, 2026 at 12:42 am
  • Editorial Team
    Editorial Team added an answer One of the better articles I've read is "Principles of… May 14, 2026 at 12:42 am
  • Editorial Team
    Editorial Team added an answer Eclipse doesn't support EL autocomplete yet. It isn't that smart… May 14, 2026 at 12:42 am

Related Questions

I've seen several other posts similar to this (namely https://stackoverflow.com/questions/5237/solutions-for-working-with-multiple-branches-in-asp-net ) but there are
I have several projects and a website in a large asp.net solution. In some
I'm still yet to find a decent solution to my scenario. Basically I have
This problem has been solved thanks to your suggestions. See the bottom for details.
I am using SqlMetal to general my DataContext.dbml class for my ASP.net application using

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.