All pastes #106031 Raw Edit

Domain / subdoman C#

public text v1 · immutable
#106031 ·published 2006-07-30 02:16 UTC
rendered paste body
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;


namespace BrinksterDefault {


public class BDefault : System.Web.UI.Page {


protected System.Web.UI.WebControls.Label message;
protected String siteNameUrl=null;


//CONSTRUCTOR
public BDefault() {Page.Init += new System.EventHandler(Page_Init);}


//PAGE LOAD
private void Page_Load(object sender, System.EventArgs e) {
	
//retrieve url info
siteNameUrl = Request.ServerVariables.Get("SERVER_NAME");

//Set message label to null and hide
message.Text="";
message.Visible=false;

switch(siteNameUrl){
	case "www.mywebsite.org":
	{
		message.Text = "The web site " + siteNameUrl + " is currently under construction. We hope to have the site available soon! Please check back with us in a few days.";
		message.Visible=true;
//		Response.Redirect("");
		break;
	}
	case "www.mywebsite.com":
	{
		message.Text = "The web site " + siteNameUrl + " is currently under construction. We hope to have the site available soon! Please check back with us in a few days.";
		message.Visible=true;
//		Response.Redirect("");
		break;
	}
	case "www.mywebsite.net":
	{
		message.Text = "The web site " + siteNameUrl + " is currently under construction. We hope to have the site available soon! Please check back with us in a few days.";
		message.Visible=true;
//		Response.Redirect("");
		break;
	}
	//For development public
	case "mywesite.brinkster.net":
	{
		Response.Redirect("default.aspx");//website located in base webroot directory
		break;
	}
	//For development local machine
	case "localhost":
	{
		Response.Redirect("../mydir/default.aspx");
		break;
	}
	default:
	{
		message.Text = "The web site " + siteNameUrl + " is currently under construction. We hope to have the site available soon! Please check back with us in a few days.";
		message.Visible=true;
//		Response.Redirect("");
		break;
	}

}
}

private void Page_Init(object sender, EventArgs e) {
	//
        // CODEGEN: This call is required by the ASP.NET Web Form Designer.
        //
        InitializeComponent();
}

#region Web Form Designer generated code

/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.

private void InitializeComponent() {    
	this.Load += new System.EventHandler(this.Page_Load);
}
#endregion

}
}