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

  • Home
  • SEARCH
  • 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 7622391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:26:26+00:00 2026-05-31T04:26:26+00:00

i have created a new web forms application in visual studio 2010 with just

  • 0

i have created a new web forms application in visual studio 2010 with just two pages Default.aspxand About.aspx. what i want is that when i debug the app in visual studio development server it and enter http://company1.localhost:1023 it should just display Default page with message This is default page for company1. How can i do it with just playing with url routing as opposed to doing settings in IIS
Note: I understand that multi-tenancy is a big word and should not be used for such a simple scenario but my requirements are simple. i would just run same instance of the application for each company with no extension points. This question could also be stated as how can i create subdomains programmatically.

  • 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-31T04:26:27+00:00Added an answer on May 31, 2026 at 4:26 am

    You have to configure IIS (and perhaps DNS) correctly for this work. For example, all your sub-domains should handle by the designated web-site in IIS. Typically, you may configure IIS to handle all host-headers if there are only single web site but in case of multiple web-sites, IIS is typically configured to differ by host header. So getting this configuration right is the important part for you.

    Once you reach to the correct web-site, resource handling will be done by IIS meta-base. So in this case, it would re-direct to configured default resource for the site. If resource-name is present then extension (htm, aspx) will decide the handling. Aspx extensions will handled by ASP.NET and then all you need to do is to look up current host header and take a decision accordingly. For example,

    protected void Page_Load(object sender, EventArgs e)
    {
        if (request.Url.HostNameType == UriHostNameType.Dns)
        {
           var hostParts = Request.Url.Host.Split('.');
           // you may validate if sub-domain name is present or not
           lblMessage.Text = "This is default page for " + hostParts[0];
        }  
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a new web application project in Visual Studio 2008, and then copied
I have a new MVC3 application with a few legacy Web Form pages. I'm
I just created a new web application that accepts some form based input from
I am using the webapplicationbuilder class to create a new web application and have
I am new to web development, I have to create a web application in
I have created a new table including a column note. The default is varchar(255)
I have created a new ActionFilter for an ASP.NET MVC application that I'm creating.
In my web application I have created a form that will allow users to
I have a web application that include a reference which will create a new
Please help! I am new to the .NET web application development. I have used

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.